summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-15 16:08:20 +0800
committerLennart Poettering <lennart@poettering.net>2014-01-15 20:16:20 +0100
commit31927c16deb4b0fdc887220df54505fd6993822f (patch)
treea5961e1efd6a272e5ddfd7038dcdc8dca419a372
parentac3efa8ac62b60261d6c101bc98831316523b07a (diff)
event: extend priority raneg to 64bit
The kdbus prioq logic will use 64bit prios too, so let's keep this similar in style. Using 64bit here has the advantage, that pointers and pretty much anything else can be mapped naturally to priorities if so desired.
-rw-r--r--src/libsystemd/sd-event.c6
-rw-r--r--src/systemd/sd-event.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libsystemd/sd-event.c b/src/libsystemd/sd-event.c
index 0b7b71d16e..f33a9ecf9a 100644
--- a/src/libsystemd/sd-event.c
+++ b/src/libsystemd/sd-event.c
@@ -61,7 +61,7 @@ struct sd_event_source {
bool pending:1;
bool dispatching:1;
- int priority;
+ int64_t priority;
unsigned pending_index;
unsigned prepare_index;
unsigned pending_iteration;
@@ -1145,14 +1145,14 @@ _public_ int sd_event_source_get_signal(sd_event_source *s) {
return s->signal.sig;
}
-_public_ int sd_event_source_get_priority(sd_event_source *s, int *priority) {
+_public_ int sd_event_source_get_priority(sd_event_source *s, int64_t *priority) {
assert_return(s, -EINVAL);
assert_return(!event_pid_changed(s->event), -ECHILD);
return s->priority;
}
-_public_ int sd_event_source_set_priority(sd_event_source *s, int priority) {
+_public_ int sd_event_source_set_priority(sd_event_source *s, int64_t priority) {
assert_return(s, -EINVAL);
assert_return(s->event->state != SD_EVENT_FINISHED, -ESTALE);
assert_return(!event_pid_changed(s->event), -ECHILD);
diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h
index 4c1fbf2c33..b911485671 100644
--- a/src/systemd/sd-event.h
+++ b/src/systemd/sd-event.h
@@ -101,8 +101,8 @@ sd_event_source* sd_event_source_unref(sd_event_source *s);
int sd_event_source_set_prepare(sd_event_source *s, sd_event_handler_t callback);
int sd_event_source_get_pending(sd_event_source *s);
-int sd_event_source_get_priority(sd_event_source *s, int *priority);
-int sd_event_source_set_priority(sd_event_source *s, int priority);
+int sd_event_source_get_priority(sd_event_source *s, int64_t *priority);
+int sd_event_source_set_priority(sd_event_source *s, int64_t priority);
int sd_event_source_get_enabled(sd_event_source *s, int *enabled);
int sd_event_source_set_enabled(sd_event_source *s, int enabled);
void* sd_event_source_get_userdata(sd_event_source *s);