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
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.
0 commit comments