-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
locks and rlocks use destructors #18640
Conversation
initSysLock(lock.lock) | ||
|
||
when useOrcArc: | ||
proc `=sink`*(x: var Lock, y: Lock) {.error.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cause of CI failure seemed to be this: I will look into it some days later(for instance duplicate the test in the tests/stdlib directory instead). |
With this PR, locks and rlocks module can switch to destructors gradually. However it causes inconsistence between arc and refc implementation, users need to implement separate codes. Or it can be hidden under the umbrella of nimPreviewX. |
This PR wants to adding destructors for Lock/Rlock/Cond for ARC/ORC and does less harm. It turns
deinitLock
,deinitRlock
,deinitCond
into a no-op and deprecates them. Then it also adds destructors for these objects.Same transition method could be applied to
Stream
,File
,socket
or so if it were fine. It should cause less harm and less breaking changes. Then we don't need to closeFile
,Stream
manually.