This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 13352 - RFE: better information from Mutex as to what is held
Summary: RFE: better information from Mutex as to what is held
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: API
Depends on: 32439
Blocks: 16328
  Show dependency tree
 
Reported: 2001-06-30 18:24 UTC by Jesse Glick
Modified: 2008-12-22 18:54 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2001-06-30 18:24:46 UTC
Really two related RFEs:

Some provision in Mutex (set in constructor perhaps so only available
to creator and holder of mutex) for finding out when the mutex is
acquired and released, and in which mode. Could be useful e.g. for
batching up change events until a mutex is released for efficiency.

boolean Mutex.have{Read,Write}Access(). Should tell you if the current
thread is currently inside the dynamic scope of a reader or writer,
resp. Of course if it is inside the scope of a writer, then
haveReadAccess() would be true as well.
Comment 1 Jesse Glick 2001-10-19 15:35:49 UTC
I guess Ales knows a lot about Mutex, provisionally assigning to you.
Comment 2 Jan Chalupa 2001-11-27 13:02:57 UTC
Target milestone -> 3.3.1.
Comment 3 Marek Grummich 2002-07-22 11:26:18 UTC
Set target milestone to TBD
Comment 4 Marek Grummich 2002-07-22 11:28:08 UTC
Set target milestone to TBD
Comment 5 Jesse Glick 2003-03-27 23:09:08 UTC
In issue #32439 patch:

- canRead() and canWrite() are implemented

- postReadRequest() is probably enough to batch up change firing from
within a write mutex; it will be run in the read mutex just after
exiting the (outermost) write mutex but before returning from the
method which exited that write mutex; other readers can be running
during it, but that is probably OK, since if you needed them to have
all changes fired to them before they saw the new state, then you
should have fired changes synch anyway (or else reader code running
deeply within the write mutex might see the wrong result)
Comment 6 Jesse Glick 2003-09-09 16:52:16 UTC
Prefer not to touch existing Mutex API; rather create a cleaner
replacement.
Comment 7 Jaroslav Tulach 2003-09-10 07:25:17 UTC
boolean Mutex.have{Read,Write}Access() would not mean any change to
semantics. Please reconsider reopening.
Comment 8 Jesse Glick 2003-09-10 18:21:36 UTC
Would be a safe semantic addition, true, but it would mean adding such
methods to the old Mutex codebase. I certainly do not want to attempt
that. If you want to, go ahead.