lkml.org 
[lkml]   [2015]   [Nov]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 1/4] wait.[ch]: Introduce the simple waitqueue (swait) implementation
On Tue, 20 Oct 2015, Daniel Wagner wrote:
> +
> +extern void swake_up(struct swait_queue_head *q);
> +extern void swake_up_all(struct swait_queue_head *q);
> +extern void swake_up_locked(struct swait_queue_head *q);

I intentionally named these functions swait_wake* in my initial
implementation for two reasons:

- typoing wake_up vs. swake_up only emits a compiler warning and does
not break the build

- I really prefer new infrastructure to have a consistent prefix
which reflects the "subsystem". That's simpler to read and simpler
to grep for.

> +extern void __prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait);
> +extern void prepare_to_swait(struct swait_queue_head *q, struct swait_queue *wait, int state);
> +extern long prepare_to_swait_event(struct swait_queue_head *q, struct swait_queue *wait, int state);
> +
> +extern void __finish_swait(struct swait_queue_head *q, struct swait_queue *wait);
> +extern void finish_swait(struct swait_queue_head *q, struct swait_queue *wait);

Can we please go with the original names?

swait_prepare()
swait_prepare_locked()
swait_finish()
swait_finish_locked()

Hmm?

> +#define swait_event(wq, condition) \

Here we have the same swait vs. wait problem as above. So either we
come up with a slightly different name or have an explicit type check
in __swait_event event.

Thanks,

tglx




\
 
 \ /
  Last update: 2015-11-04 12:01    [W:0.330 / U:2.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site