You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I just wonder if it is possible to recursively support wait and signal?
actorMyActor{privateletsemaphore=AsyncSemaphore(value:1)func serializedMethod()async{// Makes sure no two tasks can execute// serializedMethod() concurrently. await semaphore.wait()defer{ semaphore.signal()}awaitdoSomething()awaitdoSomethingElse()}func doSomething()async{await semaphore.wait()// <-- deadlock here are it will wait for the first signal to happendefer{ semaphore.signal()}awaitdoSomethingElse()}}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey,
I just wonder if it is possible to recursively
support
wait andsignal
?Beta Was this translation helpful? Give feedback.
All reactions