DragonFly BSD
DragonFly kernel List (threaded) for 2011-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: race condition in knote deletion?


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Tue, 1 Feb 2011 17:26:23 -0800 (PST)

:        kn->kn_status |= KN_DELETING | KN_REPROCESS;
:
:So  wouldn't another cpu running knote_release() while the 1st one
:sleeps call knote_detach_and_drop() too
:causing a crash when the 1st cpu resumes?

    Only the thread which set KN_PROCESSING can release the knote,
    so it shouldn't be possible.  Other threads will see that KN_PROCESSING
    is already set and not try to do anything drastic to the knote.
    
					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



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