3 ms·
I have seen bit fields used in real code. Long ago. The reason I know it so well is that bit field updates are NOT atomic, and this caused a rare crashing bug
by dirt_like 1y ago
I have seen bit fields used in real code. Long ago. The reason I know it so well is that bit field updates are NOT atomic, and this caused a rare crashing bug under heavy load. Unless you read the header the code looks atomic.
S->buffer_free = 1;
This is a very serious limitation if the structure/class is being updated in a multi-threaded environment.