lkml.org 
[lkml]   [2016]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -v4 1/8] locking/drm: Kill mutex trickery
On 10/07/2016 12:13 PM, Peter Zijlstra wrote:
> On Fri, Oct 07, 2016 at 08:58:43AM -0700, Linus Torvalds wrote:
>> The other choice would be to just make the choices be negative (==
>> recursive), zero (== failed) or positive (== got lock), which allows
>> for the same value re-use for the non-recursive case, and you could
>> avoid the enum entirely.
> I thought about that, but liked the enum better for having to then spell
> it out.
>
> I'll go make the enum shout and add comment as you suggest.

I like the idea of having a tri-state returned value (<0, 0, >0). I
don't mind having the enum, but just making mutex_trylock_recursive
equal to -1 will be great.

Cheers,
Longman

\
 
 \ /
  Last update: 2016-10-08 00:00    [W:0.154 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site