diff options
author | drh <drh@noemail.net> | 2010-05-31 16:10:12 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2010-05-31 16:10:12 +0000 |
commit | 20e1f08e0bcfc35e30817dfefc5507305b5bfd8f (patch) | |
tree | ee2c04cde49361f3b347a453911ba7309d6a06a9 /src/os_unix.c | |
parent | 18b7f604aa5c9e7f7b64f20b1e9831a17aa586a5 (diff) | |
download | sqlite-20e1f08e0bcfc35e30817dfefc5507305b5bfd8f.tar.gz sqlite-20e1f08e0bcfc35e30817dfefc5507305b5bfd8f.zip |
Get the new xShmLock interface design working on os_win.c.
FossilOrigin-Name: 149a7082e266edf0dc25c23823a9e240f5285215
Diffstat (limited to 'src/os_unix.c')
-rw-r--r-- | src/os_unix.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/src/os_unix.c b/src/os_unix.c index b0602ac2a..659e91f3b 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -3183,42 +3183,6 @@ struct unixShm { #define UNIX_SHM_BASE ((18+SQLITE_SHM_NLOCK)*4) /* first lock byte */ #define UNIX_SHM_DMS (UNIX_SHM_BASE+SQLITE_SHM_NLOCK) /* deadman switch */ -#ifdef SQLITE_DEBUG -/* -** Return a pointer to a nul-terminated string in static memory that -** describes a locking mask. The string is of the form "MSABCD" with -** each character representing a lock. "M" for MUTEX, "S" for DMS, -** and "A" through "D" for the region locks. If a lock is held, the -** letter is shown. If the lock is not held, the letter is converted -** to ".". -** -** This routine is for debugging purposes only and does not appear -** in a production build. -*/ -static const char *unixShmLockString(u16 maskShared, u16 maskExclusive){ - static char zBuf[52]; - static int iBuf = 0; - int i; - u16 mask; - char *z; - - z = &zBuf[iBuf]; - iBuf += 16; - if( iBuf>=sizeof(zBuf) ) iBuf = 0; - for(i=0, mask=1; i<SQLITE_SHM_NLOCK; i++, mask += mask){ - if( mask & maskShared ){ - z[i] = 's'; - }else if( mask & maskExclusive ){ - z[i] = 'E'; - }else{ - z[i] = '.'; - } - } - z[i] = 0; - return z; -} -#endif /* SQLITE_DEBUG */ - /* ** Apply posix advisory locks for all bytes from ofst through ofst+n-1. ** @@ -3283,8 +3247,8 @@ static int unixShmSystemLock( OSTRACE(("write-lock %d failed", ofst)); } } - OSTRACE((" - afterwards %s\n", - unixShmLockString(pShmNode->sharedMask, pShmNode->exclMask))); + OSTRACE((" - afterwards %03x,%03x\n", + pShmNode->sharedMask, pShmNode->exclMask)); } #endif @@ -3707,8 +3671,8 @@ static int unixShmLock( } } sqlite3_mutex_leave(pShmNode->mutex); - OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %s\n", - p->id, getpid(), unixShmLockString(p->sharedMask, p->exclMask))); + OSTRACE(("SHM-LOCK shmid-%d, pid-%d got %03x,%03x\n", + p->id, getpid(), p->sharedMask, p->exclMask)); return rc; } |