[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r2946 - in GNUnet/src: applications/advertising util
From: |
durner |
Subject: |
[GNUnet-SVN] r2946 - in GNUnet/src: applications/advertising util |
Date: |
Wed, 31 May 2006 14:54:37 -0700 (PDT) |
Author: durner
Date: 2006-05-31 14:54:32 -0700 (Wed, 31 May 2006)
New Revision: 2946
Modified:
GNUnet/src/applications/advertising/bootstrap.c
GNUnet/src/util/cron.c
GNUnet/src/util/semaphore.c
Log:
fix thread signaling under MinGW
Modified: GNUnet/src/applications/advertising/bootstrap.c
===================================================================
--- GNUnet/src/applications/advertising/bootstrap.c 2006-05-31 19:35:34 UTC
(rev 2945)
+++ GNUnet/src/applications/advertising/bootstrap.c 2006-05-31 21:54:32 UTC
(rev 2946)
@@ -213,7 +213,6 @@
/**
* Stop advertising.
- * @todo [WIN] Check if this works under Windows
*/
void stopBootstrap() {
void * unused;
Modified: GNUnet/src/util/cron.c
===================================================================
--- GNUnet/src/util/cron.c 2006-05-31 19:35:34 UTC (rev 2945)
+++ GNUnet/src/util/cron.c 2006-05-31 21:54:32 UTC (rev 2946)
@@ -127,14 +127,7 @@
#ifndef WINDOWS
static void sigalrmHandler(int sig) {
}
-#else
-static void CALLBACK sigalrmHandler(DWORD sig) {
-#if DEBUG_CRON
- LOG(LOG_CRON,
- "Received signal 'SIGALRM'.\n");
#endif
-}
-#endif
static Mutex inBlockLock_;
@@ -274,12 +267,7 @@
static void abortSleep() {
if (cron_signal == NULL)
return; /* cron_handle not valid */
-#ifdef WINDOWS
- QueueUserAPC((PAPCFUNC) sigalrmHandler,
- IsWinNT() ? 0 : GetCurrentThread(), 0);
-#else
PTHREAD_KILL(&cron_handle, SIGALRM);
-#endif
}
Modified: GNUnet/src/util/semaphore.c
===================================================================
--- GNUnet/src/util/semaphore.c 2006-05-31 19:35:34 UTC (rev 2945)
+++ GNUnet/src/util/semaphore.c 2006-05-31 21:54:32 UTC (rev 2946)
@@ -306,7 +306,15 @@
return OK;
}
+#ifdef WINDOWS
/**
+ * @brief Called if a sleeping thread is interrupted
+ */
+static void CALLBACK __PTHREAD_SIGNALED(DWORD sig) {
+}
+#endif
+
+/**
* Returns YES if pt is the handle for THIS thread.
*/
int PTHREAD_SELF_TEST(PTHREAD_T * pt) {
@@ -443,7 +451,15 @@
BREAK();
return;
}
+#ifdef WINDOWS
+ if (signal != 0)
+ ret = QueueUserAPC((PAPCFUNC) __PTHREAD_SIGNALED,
+ pthread_getw32threadhandle_np(*handle), 0) != 0 ? 0 : EINVAL;
+ else
+ ret = pthread_kill(*handle, 0);
+#else
ret = pthread_kill(*handle, signal);
+#endif
switch (ret) {
case 0:
break; /* ok */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r2946 - in GNUnet/src: applications/advertising util,
durner <=