cygserver: Speed up non-debug scenario
_log/_vlog were always called so we always had a function call hit even if we're not debugging. Expand on the debugging macros so the decision to call _log/_vlog is done in the caller already. Also, make a log level difference between syscall_printf and system_printf. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
@ -40,13 +40,13 @@ mtx_init (mtx *m, const char *name, const void *, int)
|
||||
void
|
||||
_mtx_lock (mtx *m, DWORD winpid, const char *file, int line)
|
||||
{
|
||||
_log (file, line, LOG_DEBUG, "Try locking mutex %s (%u) (hold: %u)",
|
||||
_debug (file, line, "Try locking mutex %s (%u) (hold: %u)",
|
||||
m->name, winpid, m->owner);
|
||||
if (WaitForSingleObject (m->h, INFINITE) != WAIT_OBJECT_0)
|
||||
_panic (file, line, "wait for %s in %d failed, %u", m->name, winpid,
|
||||
GetLastError ());
|
||||
m->owner = winpid;
|
||||
_log (file, line, LOG_DEBUG, "Locked mutex %s/%u (owner: %u)",
|
||||
_debug (file, line, "Locked mutex %s/%u (owner: %u)",
|
||||
m->name, ++m->cnt, winpid);
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ _mtx_unlock (mtx *m, const char *file, int line)
|
||||
_panic (file, line, "release of mutex %s failed, %u", m->name,
|
||||
GetLastError ());
|
||||
}
|
||||
_log (file, line, LOG_DEBUG, "Unlocked mutex %s/%u (owner: %u)",
|
||||
_debug (file, line, "Unlocked mutex %s/%u (owner: %u)",
|
||||
m->name, cnt, owner);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user