Skip to content

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Aug 3, 2021

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 close File, Stream manually.

ringabout and others added 3 commits August 3, 2021 22:37
initSysLock(lock.lock)

when useOrcArc:
proc `=sink`*(x: var Lock, y: Lock) {.error.}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ringabout
Copy link
Member Author

The cause of CI failure seemed to be this: arc + threads + tlsEmulation

#18644

I will look into it some days later(for instance duplicate the test in the tests/stdlib directory instead).

@ringabout ringabout changed the title [wip]locks and rlock use destructors locks and rlock use destructors Aug 29, 2021
@ringabout ringabout changed the title locks and rlock use destructors locks and rlocks use destructors Aug 29, 2021
@ringabout
Copy link
Member Author

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.

@ringabout ringabout closed this Aug 30, 2021
@ringabout ringabout reopened this Aug 30, 2021
@ringabout ringabout closed this Sep 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants