Now with tests (copied from https://cs.opensource.google/go/go/+/master:src/sync/cond_test.go;drc=4a3071696ddfb13e1a8f35f76197b7b3143492f4): https://go.dev/play/p/BpLBYsSSqn2?v=gotip
On Wednesday, January 17, 2024 at 5:38:18 PM UTC-5 Bryan C. Mills wrote: > Perhaps something like this: > https://go.dev/play/p/wllkgRAtd4a > > Disclaimer: not yet tested, probably contains bugs. > Also, I strongly _disrecommend_ the use of condition variables, because > they're too bug-prone. 🙃 > > On Friday, January 12, 2024 at 2:48:09 PM UTC-5 Rochus Keller wrote: > >> > Something like this? https://go.dev/play/p/_H3kFjprAGG >> >> No, sorry. The goal is to emulate a full monitor just with channels, as >> demonstrated in the referenced text (see the Stack example). The Mutex is >> likely correct, but the Signal has yet to pass the scrutinity of the folks >> here. >> >> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/01acb171-cbf7-42ee-9dd3-6e13f7413b0cn%40googlegroups.com.