summaryrefslogtreecommitdiffstats
path: root/source/lib/messages.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-12-06 00:05:15 +0000
committerJeremy Allison <jra@samba.org>2000-12-06 00:05:15 +0000
commit9dea7b7c257db487f8ced7dad3fce92fba03ea91 (patch)
tree3fa8f299ec21342b986bee32dc40ddefc32f6c1e /source/lib/messages.c
parentc9884e16fc2d13dd62c5a43633c9a38dadc9822c (diff)
downloadsamba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.tar.gz
samba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.tar.xz
samba-9dea7b7c257db487f8ced7dad3fce92fba03ea91.zip
Changed to sourceforge tdb code. This includes spinlocks (so we now have
a --with-spinlocks option to configure, this does mean the on-disk tdb format has changed, so 2.2alphaX sites will need to re-create their tdb's. The upside is no more tdb fragmentation and a +5% on netbench. Swings and roundabouts.... Jeremy.
Diffstat (limited to 'source/lib/messages.c')
-rw-r--r--source/lib/messages.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/lib/messages.c b/source/lib/messages.c
index c30c389d490..e5aafcb6461 100644
--- a/source/lib/messages.c
+++ b/source/lib/messages.c
@@ -174,7 +174,7 @@ BOOL message_send_pid(pid_t pid, int msg_type, void *buf, size_t len, BOOL dupli
kbuf = message_key_pid(pid);
/* lock the record for the destination */
- tdb_lockchain(tdb, kbuf);
+ tdb_chainlock(tdb, kbuf);
dbuf = tdb_fetch(tdb, kbuf);
@@ -208,7 +208,7 @@ BOOL message_send_pid(pid_t pid, int msg_type, void *buf, size_t len, BOOL dupli
if (!len || (len && !memcmp( ptr + sizeof(rec), (char *)buf, len))) {
DEBUG(10,("message_send_pid: discarding duplicate message.\n"));
free(dbuf.dptr);
- tdb_unlockchain(tdb, kbuf);
+ tdb_chainunlock(tdb, kbuf);
return True;
}
}
@@ -232,11 +232,11 @@ BOOL message_send_pid(pid_t pid, int msg_type, void *buf, size_t len, BOOL dupli
free(dbuf.dptr);
ok:
- tdb_unlockchain(tdb, kbuf);
+ tdb_chainunlock(tdb, kbuf);
return message_notify(pid);
failed:
- tdb_unlockchain(tdb, kbuf);
+ tdb_chainunlock(tdb, kbuf);
return False;
}
@@ -253,7 +253,7 @@ static BOOL message_recv(int *msg_type, pid_t *src, void **buf, size_t *len)
kbuf = message_key_pid(sys_getpid());
- tdb_lockchain(tdb, kbuf);
+ tdb_chainlock(tdb, kbuf);
dbuf = tdb_fetch(tdb, kbuf);
if (dbuf.dptr == NULL || dbuf.dsize == 0) goto failed;
@@ -288,11 +288,11 @@ static BOOL message_recv(int *msg_type, pid_t *src, void **buf, size_t *len)
tdb_store(tdb, kbuf, dbuf, TDB_REPLACE);
free(dbuf.dptr);
- tdb_unlockchain(tdb, kbuf);
+ tdb_chainunlock(tdb, kbuf);
return True;
failed:
- tdb_unlockchain(tdb, kbuf);
+ tdb_chainunlock(tdb, kbuf);
return False;
}