lkml.org 
[lkml]   [1999]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: deadlock avoidance?
Date
Wednesday, December 08, 1999 1:32 AM
Davide Libenzi <dlibenzi@maticad.it> wrote :
> Wouldn't lock->pid need to be atomic?
>
> On x86 this shouldn't be an issue since atomic_read has no magic but on
> other architectures, lock->pid setting and reading may race.
>

All pid and count modify fall inside 1) a nested lock ( ie. the task
already own the lock : ++lock->count )
2) a lock acquired : lock->pid = getpid() and ++lock->count

Cheers,
Davide.

--
"Debian, the Freedom in Freedom."


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

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:3.219 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site