lkml.org 
[lkml]   [2000]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch-2.4.0-test5-pre1] nullfs and forced umount
On Tue, 18 Jul 2000, Tigran Aivazian wrote:
> repeat:
> read_lock(&tasklist_lock);
> for_each_task(p) {
> blabla, need to block next
> task_lock(p);
> get_task_struct(p);
> task_unlock(p);
> read_unlock(&tasklist_lock);
> block and manipulate p
> goto repeat;
> }

actually, the above is wrong - there is no need for task_lock/unlock
around get_task_struct because the count is atomic. Also, where is
put_task_struct() (which should atomic_dec() the same count).

regards,
Tigran


-
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:57    [W:2.058 / U:1.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site