/* Initialization, mutex must be held */
mutex_t initialize_mutex;
int initialize_called;
- thread_t initialize_thread;
+ thread_id_t initialize_thread;
} Module;
/*
initialize_module_unlocked_reentrant (Module *mod)
{
CK_RV rv = CKR_OK;
- thread_t self;
+ thread_id_t self;
assert (mod);
- self = _p11_thread_self ();
+ self = _p11_thread_id_self ();
if (mod->initialize_thread == self) {
_p11_message ("p11-kit initialization called recursively");
typedef HANDLE thread_t;
+typedef DWORD thread_id_t;
+
#define _p11_mutex_init(m) \
(InitializeCriticalSection (m))
#define _p11_mutex_lock(m) \
int _p11_thread_join (thread_t thread);
-#define _p11_thread_self() \
- (GetCurrentThread ())
+/* Returns a thread_id_t */
+#define _p11_thread_id_self() \
+ (GetCurrentThreadId ())
typedef HMODULE dl_module_t;
typedef pthread_t thread_t;
+typedef pthread_t thread_id_t;
+
typedef void * (*thread_routine) (void *arg);
#define _p11_thread_create(t, r, a) \
(pthread_create ((t), NULL, (r), (a)))
#define _p11_thread_join(t) \
(pthread_join ((t), NULL))
-#define _p11_thread_self(m) \
+#define _p11_thread_id_self(m) \
(pthread_self ())
typedef void * dl_module_t;