UPnPsdk 0.1
Universal Plug and Play +, Software Development Kit
 
Loading...
Searching...
No Matches
TimerThread.hpp
Go to the documentation of this file.
1#ifndef COMPA_TIMERTHREAD_HPP
2#define COMPA_TIMERTHREAD_HPP
3/*******************************************************************************
4 *
5 * Copyright (c) 2000-2003 Intel Corporation
6 * All rights reserved.
7 * Copyright (C) 2021 GPL 3 and higher by Ingo Höft, <Ingo@Hoeft-online.de>
8 * Redistribution only with this Copyright remark. Last modified: 2025-04-28
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions are met:
12 *
13 * * Redistributions of source code must retain the above copyright notice,
14 * this list of conditions and the following disclaimer.
15 * * Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 * * Neither name of Intel Corporation nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 *
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL OR
26 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
30 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 *
34 ******************************************************************************/
44#include "ThreadPool.hpp"
45
51
70
80 TimerThread* timer,
83 ThreadPool* tp);
84
95 TimerThread* timer,
98 time_t timeout,
101 TimeoutType type,
103 ThreadPoolJob* job,
104 Duration duration,
106 int* id);
107
117// Don't export function symbol; only used library intern.
120 TimerThread* timer,
122 int id,
124 ThreadPoolJob* out);
125
136 TimerThread* timer);
137
138#endif /* COMPA_TIMERTHREAD_HPP */
Stores head and size of free list, as well as mutex for protection.
Definition FreeList.hpp:63
Linked list (no protection).
Manage a threadpool (for internal use only).
Duration
Duration.
A thread pool.
Internal ThreadPool Job.
LinkedList eventQ
[in]
int TimerThreadShutdown(TimerThread *timer)
Shutdown the timer thread.
pthread_mutex_t mutex
[in]
pthread_cond_t condition
[in]
int TimerThreadInit(TimerThread *timer, ThreadPool *tp)
Initializes and starts timer thread.
int TimerThreadSchedule(TimerThread *timer, time_t timeout, TimeoutType type, ThreadPoolJob *job, Duration duration, int *id)
Schedules an event to run at a specified time.
int lastEventId
[in]
ThreadPool * tp
[in]
FreeList freeEvents
[in]
int TimerThreadRemove(TimerThread *timer, int id, ThreadPoolJob *out)
Removes an event from the timer Q.
int shutdown
[in]
TimeoutType
Timeout Types.
@ ABS_SEC
seconds from Jan 1, 1970.
@ REL_SEC
seconds from current time.
A timer thread that allows the scheduling of a job to run at a specified time in the future.