[Groonga-commit] groonga/groonga [master] Fix the return value of THREAD_JOIN().

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 21日 (水) 11:56:17 JST


Susumu Yata	2012-03-21 11:56:17 +0900 (Wed, 21 Mar 2012)

  New Revision: 214913fe7de26a63babfd9df0ec56d32e5595f64

  Log:
    Fix the return value of THREAD_JOIN().
    
    The new THREAD_JOIN() returns zero on success, non-zero on failure.

  Modified files:
    lib/groonga_in.h

  Modified: lib/groonga_in.h (+2 -2)
===================================================================
--- lib/groonga_in.h    2012-03-21 11:32:29 +0900 (6a8fa2b)
+++ lib/groonga_in.h    2012-03-21 11:56:17 +0900 (1d6f824)
@@ -254,7 +254,7 @@ typedef int grn_sock;
 #include <pthread.h>
 typedef pthread_t grn_thread;
 #define THREAD_CREATE(thread,func,arg) (pthread_create(&(thread), NULL, (func), (arg)))
-#define THREAD_JOIN(thread) pthread_join(thread, NULL);
+#define THREAD_JOIN(thread) (pthread_join(thread, NULL))
 typedef pthread_mutex_t grn_mutex;
 #define MUTEX_INIT(m) pthread_mutex_init(&m, NULL)
 #define MUTEX_LOCK(m) pthread_mutex_lock(&m)
@@ -323,7 +323,7 @@ typedef int grn_thread_key;
 #ifdef WIN32
 typedef uintptr_t grn_thread;
 #define THREAD_CREATE(thread,func,arg) (((thread)=_beginthreadex(NULL, 0, (func), (arg), 0, NULL)) == NULL)
-#define THREAD_JOIN(thread) WaitForSingleObject((thread), INFINITE);
+#define THREAD_JOIN(thread) (WaitForSingleObject((thread), INFINITE) == WAIT_FAILED)
 typedef HANDLE grn_mutex;
 #define MUTEX_INIT(m) ((m) = CreateMutex(0, FALSE, NULL))
 #define MUTEX_LOCK(m) WaitForSingleObject((m), INFINITE)




Groonga-commit メーリングリストの案内
Back to archive index