From: Simo S. <sim...@ti...> - 2001-02-16 09:40:37
|
Hongli Lai wrote: > > On Thu, 15 Feb 2001 09:21:14 Giovanni Corriga wrote: > > Maybe we can keep this workaround as a rule. I think that handling > > extraction directory is a garp-[zip|tar|tgz] issue, not > > [zip|tar|tgz]lib's. But if you think otherwise, I think I can add a > > tl_extractfiletodir() function to tarlib. > > The current workaround is by setting the working directory while > extracting. > But this kind of workaround is not threadsafe. > I planned pthread support in some later version of GnomeZip, > so I want everything to be more or less threadsafe. > Imagine extraction a file to one directory, while using another > window (of the same app) to extract some other file to some > other directory. > Imagine GarpArchive 1 sets the working directory to /foo, > then the pthread lib gives the control to GarpArchive 2. > GarpArchive 2's chdir() code has already been executed beforem\, > so it extracts. But because the working directory has been > altered by GarpArchive 1, it would extract to the wrong dir. > See the problem? > This problem may arise anyway also if we put the code in libgarp. What you need is a consistent locking system for system wide variables and a per thread variabile set for the variabile the are related only to a thread. -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |