bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted


From: Larry Campbell
Subject: [bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised
Date: Sat, 23 Jan 2016 21:24:47 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9

Follow-up Comment #1, bug #46956 (project gnustep):

(sorry for the formatting; don't know how to get bugzilla to preserve
indentation)

Part, but not all, of the problem is that parsingArguments is being protected
by the _lock ivar, but because parsingArguments is file static, and you can
have multiple NSUserDefaults objects in play, that's not sufficient. You need
to use classLock here.

But you can still end up with the second thread trying to call
_createArgumentDictionary getting a nil arguments dictionary. Since my
applications don't use that, I stopped there. I'll shortly be attaching a
patch that fixes that, and that adds a sleep-and-retry loop for the case where
some thread needs the standardUserDefaults but another thread is still in the
process of creating it. We probably need a similar sleep-and-retry loop for
_createArgumentDictionary but I didn't go that far because, as I said, I don't
use it.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46956>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]