Jon

Hmm - I guess I could run lock acquiry and release on my dispatcher which
runs everything in the UI thread to see if it changes anything.

Calling EnterWriteLock from a bunch of different threads should be no
problem (I've been doing that for a long time and I know I have parallel
lock acquiry attempts all the time), and I've used the approach described
for a my PC client - but I suspect both operations run in the UI context
there as well, so that would be the same thread.

I'll give my dispatcher a try when I find time - I already implemented a
workaround using a traditional lock and a "is already running" bool variable
as a workaround.

Regards
Stephan


Note: I'm not a ReaderWriterLockSlim expert, I just play one on TV (and ask
around on IRC...)

I'm told that "you can't do [what you're doing]"; specifically,
ReaderWriterLockSlim locks are per-thread. You can't acquire the lock on one
thread and release it on another. Thus, IsWriteLockHeld should not be used
for this purpose. (Assuming that we're reading the code properly...).

If we're misinterpreting your code, could you please provide a test project
for diagnostic purposes?

Thanks,
 - Jon




--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/ReaderWriterLockSlim-fully-implemented-tp5711849p5711865.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to