From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <6.1.1.1.0.20040604182329.02181b18@pop.free.fr> Date: Fri, 4 Jun 2004 18:24:36 +0200 To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> From: Philippe Anel Subject: Re: [9fans] stack reclamation on Unix using clone, rfork_thread, etc. In-Reply-To: <6.1.1.1.0.20040604175442.021d8420@pop.free.fr> References: <200406041533.i54FXNm29967@plg2.math.uwaterloo.ca> <6.1.1.1.0.20040604175442.021d8420@pop.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Topicbox-Message-UUID: 951e6d54-eacd-11e9-9e20-41e7f4b1d025 >void >exit_thread() > { > struct segment * s; > > lock(&addrspace); > for (s = addrspace.tofree; s; s = s->next) > free(s->addr); > if (--refcount) { > s = find_segment_from_id(get_my_thread_id()); > list_remove(s); > list_add(tofree, s); move the unlock call out of the block of course. > unlock(&addrspace); > } >}