diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-03-22 16:49:53 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-03-22 16:49:53 +0100 |
commit | feccdb76f572a5fad947475c21b5b9aff696b04b (patch) | |
tree | 8e70e3eefef68febe02b5447105fdc6d857426b7 /src/jobs.h | |
parent | f5ce0df45f5ce9f0b57b250dfd44513d085f1e54 (diff) |
Refactor of threading and signal monitor
The goal is to allow use of this facilities for
things that are not 'afb_req'.
Change-Id: I0d99c227934ed45136477bf6235bd1541d5f05cf
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/jobs.h')
-rw-r--r-- | src/jobs.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/jobs.h b/src/jobs.h new file mode 100644 index 00000000..ef72e0c1 --- /dev/null +++ b/src/jobs.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2016, 2017 "IoT.bzh" + * Author José Bollo <jose.bollo@iot.bzh> + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +extern int jobs_queue( + void *group, + int timeout, + void (*callback)(int signum, void* arg), + void *arg); + +extern int jobs_queue2( + void *group, + int timeout, + void (*callback)(int signum, void* arg1, void *arg2), + void *arg1, + void *arg2); + +extern int jobs_queue3( + void *group, + int timeout, + void (*callback)(int signum, void* arg1, void *arg2, void *arg3), + void *arg1, + void *arg2, + void *arg3); + +extern int jobs_init(int allowed_count, int start_count, int waiter_count); +extern void jobs_terminate(); + + |