47namespace NonRecursiveMutexImpl
50#if defined (BLOCXX_USE_PTHREAD)
52#if !defined (BLOCXX_NCR)
61 pthread_mutexattr_t attr;
62 int res = pthread_mutexattr_init(&attr);
69 res = pthread_mutex_init(&handle.mutex, &attr);
70 pthread_mutexattr_destroy(&attr);
83 pthread_mutexattr_t attr;
84 int res = pthread_mutexattr_create(&attr);
91 res = pthread_mutex_init(&handle.mutex, attr);
92 pthread_mutexattr_delete(&attr);
114 switch (pthread_mutex_destroy(&handle.mutex))
137 int res = pthread_mutex_lock(&handle.mutex);
150 int res = pthread_mutex_unlock(&handle.mutex);
158 state.pmutex = &handle.mutex;
170#if defined(BLOCXX_WIN32)
175 if ((handle = CreateMutex(NULL, FALSE, NULL)))
185 ReleaseMutex(handle);
186 return (CloseHandle(handle) == 0) ? -2 : 0;
193 if (WaitForSingleObject(handle, INFINITE) != WAIT_FAILED)
203 return (ReleaseMutex(handle)) ? 0 : -1;
209 state.pmutex = &handle;