Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006048OCamldocumentationpublic2013-06-23 06:172015-12-11 19:19
Assigned To 
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006048: It is not documented what happens when you nest caml_acquire_runtime_system()
DescriptionThe section 19.10.1 of the manual describes the caml_acquire_runtime_system() and caml_release_runtime_system().

I don't see where the text addresses what happens if you call acquire more than once from the same thread.

I looked at the Windows code and it appeared that you just need to match the number of releases to the number of acquires and you can acquire the lock more than once safely. (But I'm not certain and don't know if it's true for other OSs/build environments.)

It would be good if the topic was explained specifically.
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
xleroy (administrator)
2013-06-24 10:04

The behavior is very much unspecified: under Windows, it might work because the master lock is reentrant, but under POSIX systems it is very likely to deadlock at the second caml_release_runtime_system(). So, don't do that.

- Issue History
Date Modified Username Field Change
2013-06-23 06:17 sesquized New Issue
2013-06-24 10:04 xleroy Note Added: 0009605
2013-06-24 10:04 xleroy Status new => resolved
2013-06-24 10:04 xleroy Resolution open => no change required
2015-12-11 19:19 xleroy Status resolved => closed
2017-02-23 16:35 doligez Category OCaml documentation => Documentation
2017-02-23 16:44 doligez Category Documentation => documentation

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker