Problems with semaphores, mutexes, and atomic?

Dave Hylands dhylands at gmail.com
Mon Jun 20 03:44:16 EDT 2011


Hi Saeed,

On Mon, Jun 20, 2011 at 12:20 AM, saeed bishara <saeed.bishara at gmail.com> wrote:
> On Mon, Jun 20, 2011 at 9:39 AM, Dave Hylands <dhylands at gmail.com> wrote:
>> Hi,
>>
>> I wrote a small test module to test semaphores, mutexes and atomic
>> increments, and I've tested it with CONFIG_SMP=y with 1 and 2
>> processors and with CONFIG_SMP disabled.
>>
>> My test code can be found here:
>> http://svn.hylands.org/linux/test-mutex/test-mutex.c
>> (it's about 133 lines long).
> yout code is not complete, the DEFINE_SEMAPHORE and DEFINE_SEMAPHORE
> definitions are missing

I don't follow. Line 7 & 8 has

DEFINE_MUTEX( lock );
DEFINE_SEMAPHORE( sem_lock );

and line 19 has

DEFINE_SEMAPHORE( thread_wait );

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com



More information about the linux-arm-kernel mailing list