Fixed : crashing due to pile creation
[IRC.git] / Robust / src / Runtime / DSTM / interface / queue.c
index 7a8fbba392ade522054a244ba793079e28d7257a..954a52b5443b063e4f3b82c2f2fc9f5d2aa71002 100644 (file)
@@ -5,7 +5,10 @@ primarypfq_t pqueue; //Global queue
 void queueInit(void) {
        /* Intitialize primary queue */
        pqueue.front = pqueue.rear = NULL;
-       pthread_mutex_init(&pqueue.qlock, NULL);
+       pthread_mutexattr_init(&pqueue.qlockattr);
+       pthread_mutexattr_settype(&pqueue.qlockattr, PTHREAD_MUTEX_RECURSIVE_NP);
+       pthread_mutex_init(&pqueue.qlock, &pqueue.qlockattr);
+       //pthread_mutex_init(&pqueue.qlock, NULL);
        pthread_cond_init(&pqueue.qcond, NULL);
 }