semaphore init problem in linux
I m using sem_init() in my program. when i call this
sem_t *pSem = (sem_t*)malloc(sizeof(sem_t));
sem_init(pSem, 0, 1);
it sets the values of pSem as
the value of __sem_value is 1, means only one can
enter after sem_wait() at a time.
but when make a library of this function, and then call this funciton in my application. it sets as
the value of __sem_value is zero, therefore it does
not allow anyone to enter after sem_wait().
I dont know why it is happening.
Can anyone help me plz and get rid of this problem.
Thnx & Rgds,