After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795545 - Support explicit "unlock" corresponding to a "lock" without statements
Support explicit "unlock" corresponding to a "lock" without statements
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Parser
0.41.x
Other Linux
: Normal normal
: 0.42
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2018-04-25 14:48 UTC by Rico Tzschichholz
Modified: 2018-04-27 12:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
parser: Add support for explicit "unlock" syntax (5.00 KB, patch)
2018-04-25 14:49 UTC, Rico Tzschichholz
committed Details | Review

Description Rico Tzschichholz 2018-04-25 14:48:07 UTC
In addition to the current resource control syntax

  lock ($lockable) { ... }

it should be allowed to unlock the previously locked lockable at any desired place while still using vala's transparent support for mutexes.

  lock ($lockable);
  ...
  unlock ($lockable);
Comment 1 Rico Tzschichholz 2018-04-25 14:49:12 UTC
Created attachment 371382 [details] [review]
parser: Add support for explicit "unlock" syntax

By providing more control over the internal support for Mutex creation and
usage, this allows a more complex resource control while having an explicit
way to unlock a previously locked lockable.

  lock (foo);
  ...
  unlock (foo);
Comment 2 Rico Tzschichholz 2018-04-27 12:55:40 UTC
Attachment 371382 [details] pushed as 8898e12 - parser: Add support for explicit "unlock" syntax