[Haiku-commits] r27268 - haiku/trunk/src/system/kernel/posix

Salvatore Benedetto emitrax at gmail.com
Wed Sep 3 10:08:15 CEST 2008


2008/9/2 Ingo Weinhold <ingo_weinhold at gmx.de>:
>
> Regarding re-locking. It must be ensured that it's still the same semaphore
> set. Someone could have IPC_RMID the set and added a new one with the same
> ID. I.e. the semaphore set pointers must be the same and a global counter
> should be introduced (incremented whenever semget() adds a set to the hash
> table, and the value stored in the set).

On a second thought, I think this is not a problem, since when we
return from Wait
beside checking if the set is still valid, we also check for the
return value of thread_block_locked(),
in which case will be EIDRM, preventing us from using the set any further.

So moving the unlock right after thread_prepare_to_block(), and
removing the Wait()
to keep thing clean, should definitely fix the problem.

Regards,
-- 
Salvatore Benedetto (a.k.a. emitrax)
Student of Computer Engineer
University of Pisa
www.haiku-os.it



More information about the Haiku-commits mailing list