[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Semaphore



Hi,

I am trying to use semaphore for locking. Following is the piece of code I am using :

struct semaphore mr_sem;

sema_init(&mr_sem, 1); /* usage count is 1 */

if (down_interruptible(&mr_sem))
  /* semaphore not acquired; received a signal ... */

/* critical region (semaphore acquired) ... */

up(&mr_sem);

 

The compilation is done using gcc with options _D__KERNEL__. It compiles properly, but the linking gives some errors regards to __down_failed_interruptible and __up_wakeup.

Do I need to specify some other options for the compilation.

Thanks for the help.

-SP



Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now