mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
New event_get_priority() function to return an event's priority
This commit is contained in:
parent
a4079aa88a
commit
f90e25593c
7
event.c
7
event.c
@ -2072,6 +2072,13 @@ event_get_callback_arg(const struct event *ev)
|
||||
return ev->ev_arg;
|
||||
}
|
||||
|
||||
int
|
||||
event_get_priority(const struct event *ev)
|
||||
{
|
||||
event_debug_assert_is_setup_(ev);
|
||||
return ev->ev_pri;
|
||||
}
|
||||
|
||||
int
|
||||
event_add(struct event *ev, const struct timeval *tv)
|
||||
{
|
||||
|
@ -1124,6 +1124,12 @@ event_callback_fn event_get_callback(const struct event *ev);
|
||||
*/
|
||||
void *event_get_callback_arg(const struct event *ev);
|
||||
|
||||
/**
|
||||
Return the priority of an event.
|
||||
@see event_priority_init(), event_get_priority()
|
||||
*/
|
||||
int event_get_priority(const struct event *ev);
|
||||
|
||||
/**
|
||||
Extract _all_ of arguments given to construct a given event. The
|
||||
event_base is copied into *base_out, the fd is copied into *fd_out, and so
|
||||
@ -1226,7 +1232,7 @@ int event_base_get_npriorities(struct event_base *eb);
|
||||
@param ev an event struct
|
||||
@param priority the new priority to be assigned
|
||||
@return 0 if successful, or -1 if an error occurred
|
||||
@see event_priority_init()
|
||||
@see event_priority_init(), event_get_priority()
|
||||
*/
|
||||
int event_priority_set(struct event *, int);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user