lkml.org 
[lkml]   [2003]   [Jun]   [27]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateFri, 27 Jun 2003 09:33:46 +0100
FromJohn M Collins <>
SubjectMinor Bug with System 5 Semaphores
Please CC me on any reply as I'm not subscribed.

I've come across what seems to me to be a minor bug on System 5 semaphores.

When a process which has used a set of semaphores exits, the process id 
of the exiting process is assigned to the "sempid" of every semaphore in 
the set, not just the ones that the process has changed.

This seems to me because in kernel 2.4.21/ipc/sem.c line 1062

sem->sempid = current->pid;

should be made conditional on u->semadj[i] being non-zero.

Personally I think it would be useful to omit this assignment altogether 
and have the "sempid" value reflect the last explicit semaphore 
operation rather than the implicit ones caused by "undos".

-- 
John Collins Xi Software Ltd www.xisl.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:36    [from the cache]
©2003-2008