Linus Torvalds writes: (Summary) wrote:
I really would like to see the sites that do cross-thread lock/unlock pairs themselves be annotated.
pairs themselves be annotated.
So when you lock in one thread, and then unlock in another, I'd actually prefer to see something like
actually prefer to see something like
- T1:
lock_mutex_cross();
lock_mutex_cross();
- T2:
unlock_mutex_cross();
unlock_mutex_cross();
to make it very explicit that *these* particular lock/unlock operations are the fancy ones.
operations are the fancy ones.
So instead of associating the "special status" with the _data_, I'd much rather associate it with the _code_.
much rather associate it with the _code_.
See what I'm saying?
See what I'm saying?
This is kind of similar to my opinion on the C "volatile" keyword, and why we do not generally use it in the kernel. That's generally very easy to do, you just make
[...]
I don't understand your intention.I really would like to see the sites that do cross-thread lock/unlock pairs themselves be annotated.
pairs themselves be annotated.
So when you lock in one thread, and then unlock in another, I'd actually prefer to see something like
actually prefer to see something like
- T1:
lock_mutex_cross();
lock_mutex_cross();
- T2:
unlock_mutex_cross();
unlock_mutex_cross();
to make it very explicit that *these* particular lock/unlock operations are the fancy ones.
operations are the fancy ones.
So instead of associating the "special status" with the _data_, I'd much rather associate it with the _code_.
much rather associate it with the _code_.
See what I'm saying?
See what I'm saying?
This is kind of similar to my opinion on the C "volatile" keyword, and why we do not generally use it in the kernel. That's generally very easy to do, you just make