[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r3201 - in GNUnet/src: applications/chat applications/datas
From: |
grothoff |
Subject: |
[GNUnet-SVN] r3201 - in GNUnet/src: applications/chat applications/datastore applications/dht/module applications/fs/fsui applications/fs/lib applications/fs/module applications/fs/tools applications/rpc applications/tbench applications/testbed applications/tracekit applications/vpn transports util/os util/threads |
Date: |
Sun, 30 Jul 2006 21:34:48 -0700 (PDT) |
Author: grothoff
Date: 2006-07-30 21:34:44 -0700 (Sun, 30 Jul 2006)
New Revision: 3201
Modified:
GNUnet/src/applications/chat/gnunet-chat.c
GNUnet/src/applications/datastore/prefetch.c
GNUnet/src/applications/dht/module/cs.c
GNUnet/src/applications/dht/module/dht.c
GNUnet/src/applications/fs/fsui/file_info.c
GNUnet/src/applications/fs/fsui/fsui.c
GNUnet/src/applications/fs/lib/fslibtest.c
GNUnet/src/applications/fs/module/fs.c
GNUnet/src/applications/fs/tools/gnunet-download.c
GNUnet/src/applications/fs/tools/gnunet-insert.c
GNUnet/src/applications/fs/tools/gnunet-unindex.c
GNUnet/src/applications/rpc/rpc.c
GNUnet/src/applications/tbench/tbench.c
GNUnet/src/applications/testbed/testbed.c
GNUnet/src/applications/tracekit/gnunet-tracekit.c
GNUnet/src/applications/vpn/gnunet-vpn.c
GNUnet/src/transports/http.c
GNUnet/src/transports/smtp.c
GNUnet/src/util/os/semaphoretest.c
GNUnet/src/util/threads/semaphoretest.c
GNUnet/src/util/threads/timertest.c
Log:
sem-new is sem-create
Modified: GNUnet/src/applications/chat/gnunet-chat.c
===================================================================
--- GNUnet/src/applications/chat/gnunet-chat.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/chat/gnunet-chat.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -155,7 +155,7 @@
errexit(_("You must specify a nickname (use option `%s').\n"),
"-n");
- doneSem = SEMAPHORE_NEW(0);
+ doneSem = SEMAPHORE_CREATE(0);
if (0 != PTHREAD_CREATE(&messageReceiveThread,
&receiveThread,
sock,
Modified: GNUnet/src/applications/datastore/prefetch.c
===================================================================
--- GNUnet/src/applications/datastore/prefetch.c 2006-07-31 04:32:21 UTC
(rev 3200)
+++ GNUnet/src/applications/datastore/prefetch.c 2006-07-31 04:34:44 UTC
(rev 3201)
@@ -65,7 +65,7 @@
*/
static struct SEMAPHORE * acquireMoreSignal;
-static struct SEMAHPORE * doneSignal;
+static struct SEMAPHORE * doneSignal;
/**
* Lock for the RCB buffer.
@@ -87,7 +87,7 @@
if (doneSignal != NULL)
return SYSERR;
- SEMAPHORE_DOWN(acquireMoreSignal);
+ SEMAPHORE_DOWN(acquireMoreSignal, YES);
if (doneSignal != NULL)
return SYSERR;
MUTEX_LOCK(lock);
@@ -225,23 +225,23 @@
memset(randomContentBuffer,
0,
sizeof(ContentBuffer *)*RCB_SIZE);
- acquireMoreSignal = SEMAPHORE_NEW(RCB_SIZE);
+ acquireMoreSignal = SEMAPHORE_CREATE(RCB_SIZE);
doneSignal = NULL;
- lock = MUTEX_CREATE();
- if (0 != PTHREAD_CREATE(&gather_thread,
- (PThreadMain)&rcbAcquire,
- NULL,
- 64*1024))
- DIE_STRERROR("pthread_create");
+ lock = MUTEX_CREATE(NO);
+ gather_thread = PTHREAD_CREATE(&rcbAcquire,
+ NULL,
+ 64*1024);
+ GE_ASSERT(NULL,
+ gather_thread != NULL);
}
void donePrefetch() {
int i;
void * unused;
- doneSignal = SEMAPHORE_NEW(0);
+ doneSignal = SEMAPHORE_CREATE(0);
SEMAPHORE_UP(acquireMoreSignal);
- SEMAPHORE_DOWN(doneSignal);
+ SEMAPHORE_DOWN(doneSignal, YES);
SEMAPHORE_DESTROY(acquireMoreSignal);
SEMAPHORE_DESTROY(doneSignal);
PTHREAD_JOIN(&gather_thread, &unused);
Modified: GNUnet/src/applications/dht/module/cs.c
===================================================================
--- GNUnet/src/applications/dht/module/cs.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/dht/module/cs.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -374,9 +374,9 @@
ptr->store->closure = ptr;
ptr->handler = client;
ptr->table = req->table;
- ptr->prerequest = SEMAPHORE_NEW(1);
- ptr->prereply = SEMAPHORE_NEW(0);
- ptr->postreply = SEMAPHORE_NEW(0);
+ ptr->prerequest = SEMAPHORE_CREATE(1);
+ ptr->prereply = SEMAPHORE_CREATE(0);
+ ptr->postreply = SEMAPHORE_CREATE(0);
ret = dhtAPI->join(ptr->store,
&req->table);
if (ret == OK) {
Modified: GNUnet/src/applications/dht/module/dht.c
===================================================================
--- GNUnet/src/applications/dht/module/dht.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/dht/module/dht.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -1854,7 +1854,7 @@
fnc->table = *table;
fnc->k = 0;
fnc->matches = MALLOC(sizeof(HashCode512) * ALPHA);
- fnc->signal = SEMAPHORE_NEW(0);
+ fnc->signal = SEMAPHORE_CREATE(0);
fnc->timeout = get_time() + timeout;
fnc->rpcRepliesExpected = 0;
fnc->rpcRepliesReceived = 0;
Modified: GNUnet/src/applications/fs/fsui/file_info.c
===================================================================
--- GNUnet/src/applications/fs/fsui/file_info.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/fs/fsui/file_info.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -52,7 +52,7 @@
ipcName = expandFileName(tmpname);
FREE(basename);
FREE(tmpname);
- sem = IPC_SEMAPHORE_NEW(ipcName, 1);
+ sem = IPC_SEMAPHORE_CREATE(ipcName, 1);
FREE(ipcName);
return sem;
}
Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/fs/fsui/fsui.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -390,7 +390,7 @@
strcat(fn, name);
ret->name = fn;
if (doResume) {
- ret->ipc = IPC_SEMAPHORE_NEW(fn,
+ ret->ipc = IPC_SEMAPHORE_CREATE(fn,
1);
GE_LOG(ectx, GE_INFO | GE_REQUEST | GE_USER,
"Getting IPC lock for FSUI (%s).\n",
Modified: GNUnet/src/applications/fs/lib/fslibtest.c
===================================================================
--- GNUnet/src/applications/fs/lib/fslibtest.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/fs/lib/fslibtest.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -184,7 +184,7 @@
FREE(dv);
closure.found = NO;
closure.i = i;
- closure.sem = SEMAPHORE_NEW(0);
+ closure.sem = SEMAPHORE_CREATE(0);
cronTime(&now);
handle = FS_start_search(ctx,
D_BLOCK,
Modified: GNUnet/src/applications/fs/module/fs.c
===================================================================
--- GNUnet/src/applications/fs/module/fs.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/fs/module/fs.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -1199,7 +1199,7 @@
}
/* dht = capi->requestService("dht"); */
dht = NULL;
- ltgSignal = SEMAPHORE_NEW(0);
+ ltgSignal = SEMAPHORE_CREATE(0);
if (0 != PTHREAD_CREATE(&localGetProcessor,
&localGetter,
NULL,
Modified: GNUnet/src/applications/fs/tools/gnunet-download.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-download.c 2006-07-31 04:32:21 UTC
(rev 3200)
+++ GNUnet/src/applications/fs/tools/gnunet-download.c 2006-07-31 04:34:44 UTC
(rev 3201)
@@ -255,7 +255,7 @@
try_rename = YES;
}
FREE(fstring);
- signalFinished = SEMAPHORE_NEW(0);
+ signalFinished = SEMAPHORE_CREATE(0);
ctx = FSUI_start("gnunet-download",
NO,
&progressModel,
Modified: GNUnet/src/applications/fs/tools/gnunet-insert.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-insert.c 2006-07-31 04:32:21 UTC
(rev 3200)
+++ GNUnet/src/applications/fs/tools/gnunet-insert.c 2006-07-31 04:34:44 UTC
(rev 3201)
@@ -667,7 +667,7 @@
"-S", "-P");
}
- exitSignal = SEMAPHORE_NEW(0);
+ exitSignal = SEMAPHORE_CREATE(0);
/* fundamental init */
ctx = FSUI_start("gnunet-insert",
NO,
Modified: GNUnet/src/applications/fs/tools/gnunet-unindex.c
===================================================================
--- GNUnet/src/applications/fs/tools/gnunet-unindex.c 2006-07-31 04:32:21 UTC
(rev 3200)
+++ GNUnet/src/applications/fs/tools/gnunet-unindex.c 2006-07-31 04:34:44 UTC
(rev 3201)
@@ -173,7 +173,7 @@
verbose = testConfigurationString("GNUNET-INSERT",
"VERBOSE",
"YES");
- exitSignal = SEMAPHORE_NEW(0);
+ exitSignal = SEMAPHORE_CREATE(0);
/* fundamental init */
ctx = FSUI_start("gnunet-unindex",
NO,
Modified: GNUnet/src/applications/rpc/rpc.c
===================================================================
--- GNUnet/src/applications/rpc/rpc.c 2006-07-31 04:32:21 UTC (rev 3200)
+++ GNUnet/src/applications/rpc/rpc.c 2006-07-31 04:34:44 UTC (rev 3201)
@@ -1190,7 +1190,7 @@
CallInstance * call;
MUTEX_LOCK(rpcLock);
- cls.sem = SEMAPHORE_NEW(0);
+ cls.sem = SEMAPHORE_CREATE(0);
cls.result = returnParam;
call = MALLOC(sizeof(CallInstance));
RPC_STATUS(name, "started synchronously", call);
@@ -1525,7 +1525,7 @@
"command",
strlen("Hello")+1,
"Hello");
- sign = SEMAPHORE_NEW(0);
+ sign = SEMAPHORE_CREATE(0);
record = rpcAPI->RPC_start(coreAPI->myIdentity,
"testFunction",
args,
Modified: GNUnet/src/applications/tbench/tbench.c
===================================================================
--- GNUnet/src/applications/tbench/tbench.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/tbench/tbench.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -286,8 +286,8 @@
results[iteration].duplicateCount = 0;
earlyEnd = 0;
- presem = SEMAPHORE_NEW(1);
- postsem = SEMAPHORE_NEW(0);
+ presem = SEMAPHORE_CREATE(1);
+ postsem = SEMAPHORE_CREATE(0);
currNounce = weak_randomi(0xFFFFFF);
p2p->nounce
= htonl(currNounce);
Modified: GNUnet/src/applications/testbed/testbed.c
===================================================================
--- GNUnet/src/applications/testbed/testbed.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/testbed/testbed.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -658,7 +658,7 @@
}
MUTEX_LOCK(&lock);
- pi->sem = SEMAPHORE_NEW(0);
+ pi->sem = SEMAPHORE_CREATE(0);
if (0 != PTHREAD_CREATE(&pi->reader,
(PThreadMain) &pipeReaderThread,
pi,
Modified: GNUnet/src/applications/tracekit/gnunet-tracekit.c
===================================================================
--- GNUnet/src/applications/tracekit/gnunet-tracekit.c 2006-07-31 04:32:21 UTC
(rev 3200)
+++ GNUnet/src/applications/tracekit/gnunet-tracekit.c 2006-07-31 04:34:44 UTC
(rev 3201)
@@ -364,7 +364,7 @@
return -1;
}
- doneSem = SEMAPHORE_NEW(0);
+ doneSem = SEMAPHORE_CREATE(0);
if (0 != PTHREAD_CREATE(&messageReceiveThread,
(PThreadMain) &receiveThread,
sock,
Modified: GNUnet/src/applications/vpn/gnunet-vpn.c
===================================================================
--- GNUnet/src/applications/vpn/gnunet-vpn.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/applications/vpn/gnunet-vpn.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -120,7 +120,7 @@
void * unused;
char buffer[sizeof(CS_MESSAGE_HEADER) + 1024];
- doneSem = SEMAPHORE_NEW(0);
+ doneSem = SEMAPHORE_CREATE(0);
if (SYSERR == initUtil(argc, argv, &parseOptions))
return 0; /* parse error, --help, etc. */
sock = getClientSocket();
Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c 2006-07-31 04:32:21 UTC (rev 3200)
+++ GNUnet/src/transports/http.c 2006-07-31 04:34:44 UTC (rev 3201)
@@ -1283,7 +1283,7 @@
GE_BREAK(ectx, 0);
return SYSERR;
}
- serverSignal = SEMAPHORE_NEW(0);
+ serverSignal = SEMAPHORE_CREATE(0);
http_shutdown = NO;
if (0 != PIPE(http_pipe)) {
Modified: GNUnet/src/transports/smtp.c
===================================================================
--- GNUnet/src/transports/smtp.c 2006-07-31 04:32:21 UTC (rev 3200)
+++ GNUnet/src/transports/smtp.c 2006-07-31 04:34:44 UTC (rev 3201)
@@ -799,7 +799,7 @@
GE_BREAK(ectx, 0);
return SYSERR;
}
- serverSignal = SEMAPHORE_NEW(0);
+ serverSignal = SEMAPHORE_CREATE(0);
smtp_shutdown = NO;
/* initialize SMTP network */
Modified: GNUnet/src/util/os/semaphoretest.c
===================================================================
--- GNUnet/src/util/os/semaphoretest.c 2006-07-31 04:32:21 UTC (rev 3200)
+++ GNUnet/src/util/os/semaphoretest.c 2006-07-31 04:34:44 UTC (rev 3201)
@@ -46,7 +46,7 @@
me = fork();
sw = me;
- ipc = IPC_SEMAPHORE_NEW("/tmp/gnunet_ipc_semtest",
+ ipc = IPC_SEMAPHORE_CREATE("/tmp/gnunet_ipc_semtest",
0);
for (cnt=0;cnt<3;cnt++) {
if (sw == 0) {
Modified: GNUnet/src/util/threads/semaphoretest.c
===================================================================
--- GNUnet/src/util/threads/semaphoretest.c 2006-07-31 04:32:21 UTC (rev
3200)
+++ GNUnet/src/util/threads/semaphoretest.c 2006-07-31 04:34:44 UTC (rev
3201)
@@ -154,7 +154,7 @@
PTHREAD_T pt;
void * unused;
- sem = SEMAPHORE_NEW(42);
+ sem = SEMAPHORE_CREATE(42);
fprintf(stderr, ".");
for (i=0;i<42;i++)
SEMAPHORE_DOWN(sem); /* fails by blocking */
Modified: GNUnet/src/util/threads/timertest.c
===================================================================
--- GNUnet/src/util/threads/timertest.c 2006-07-31 04:32:21 UTC (rev 3200)
+++ GNUnet/src/util/threads/timertest.c 2006-07-31 04:34:44 UTC (rev 3201)
@@ -76,7 +76,7 @@
fprintf(stdout,
"Timer precision is acceptable.\n");
- sem = SEMAPHORE_NEW(0);
+ sem = SEMAPHORE_CREATE(0);
startCron();
cumDelta = 0;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r3201 - in GNUnet/src: applications/chat applications/datastore applications/dht/module applications/fs/fsui applications/fs/lib applications/fs/module applications/fs/tools applications/rpc applications/tbench applications/testbed applications/tracekit applications/vpn transports util/os util/threads,
grothoff <=