Commit 176a3feb authored by Kirill Smelkov's avatar Kirill Smelkov

libgolang: Fix thinko in _makechan

ch->_mu was initialized with Sema - not Mutex - constructor.
It was appearing to work because currently Mutex is a trivial wrapper
around Sema.
parent 59892def
...@@ -391,7 +391,7 @@ _chan *_makechan(unsigned elemsize, unsigned size) { ...@@ -391,7 +391,7 @@ _chan *_makechan(unsigned elemsize, unsigned size) {
if (ch == NULL) if (ch == NULL)
return NULL; return NULL;
memset((void *)ch, 0, sizeof(*ch)); memset((void *)ch, 0, sizeof(*ch));
new (&ch->_mu) Sema(); new (&ch->_mu) Mutex();
ch->_refcnt = 1; ch->_refcnt = 1;
ch->_cap = size; ch->_cap = size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment