Commit e16269e
committed
Fix incorrect open count check in release function
In the original code, the producer stops producing characters
when atomic_dec_and_test(&open_cnt) returns zero, but it will
return zero when the resulting value of open_cnt is nonzero.
Therefore, in the original code, if the open_cnt changes from
2 to 1, it will stop producing characters, but it is supposed
to consistently produce characters until the open_cnt becomes
zero.
Therefore, we modify the code so that it stops producing characters
when atomic_dec_and_test(&open_cnt) returns one.1 parent 9043d41 commit e16269e
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
| |||
0 commit comments