LibreOffice: uno/threadpool.h Source File

LibreOffice LibreOffice 26.2 SDK C/C++ API Reference

Loading...
Searching...
No Matches
threadpool.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20/*
21 * This file is part of LibreOffice published API.
22 */
23
24#ifndef INCLUDED_UNO_THREADPOOL_H
25#define INCLUDED_UNO_THREADPOOL_H
26
27#include "cppu/cppudllapi.h"
28#include "sal/types.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/***
35 * Thread identifier administration.
36 ***/
51 CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId )
52 SAL_THROW_EXTERN_C();
53
54
65 CPPU_DLLPUBLIC void SAL_CALL uno_getIdOfCurrentThread( sal_Sequence **ppThreadId )
66 SAL_THROW_EXTERN_C();
67
68
73 CPPU_DLLPUBLIC void SAL_CALL uno_releaseIdFromCurrentThread()
74 SAL_THROW_EXTERN_C();
75
76
77struct _uno_ThreadPool;
78typedef struct _uno_ThreadPool * uno_ThreadPool;
79
84 CPPU_DLLPUBLIC uno_ThreadPool SAL_CALL
85uno_threadpool_create() SAL_THROW_EXTERN_C();
86
87
99 CPPU_DLLPUBLIC void SAL_CALL
100uno_threadpool_attach( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C();
101
111 CPPU_DLLPUBLIC void SAL_CALL
112uno_threadpool_enter( uno_ThreadPool hPool , void **ppJob )
113 SAL_THROW_EXTERN_C();
114
120 CPPU_DLLPUBLIC void SAL_CALL
121uno_threadpool_detach( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C();
122
153 CPPU_DLLPUBLIC void SAL_CALL
154uno_threadpool_putJob(
155 uno_ThreadPool hPool,
156 sal_Sequence *pThreadId,
157 void *pJob,
158 void ( SAL_CALL * doRequest ) ( void *pThreadSpecificData ),
159 sal_Bool bIsOneway ) SAL_THROW_EXTERN_C();
160
172 CPPU_DLLPUBLIC void SAL_CALL
173uno_threadpool_dispose( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C();
174
175
185 CPPU_DLLPUBLIC void SAL_CALL
186uno_threadpool_destroy( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C();
187
188#ifdef __cplusplus
189}
190#endif
191
192#endif // INCLUDED_UNO_THREADPOOL_H
193
194/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
types.h
sal_Sequence
struct _sal_Sequence sal_Sequence
This is the binary specification of a SAL sequence.
sal_Bool
unsigned char sal_Bool
Definition types.h:38
SAL_THROW_EXTERN_C
#define SAL_THROW_EXTERN_C()
Nothrow specification for C functions.
Definition types.h:352
uno_threadpool_create
CPPU_DLLPUBLIC uno_ThreadPool uno_threadpool_create() SAL_THROW_EXTERN_C()
Creates a threadpool handle.
uno_releaseIdFromCurrentThread
CPPU_DLLPUBLIC void uno_releaseIdFromCurrentThread() SAL_THROW_EXTERN_C()
If the internal refcount drops to zero, the association between threadId and thread is broken.
uno_threadpool_dispose
CPPU_DLLPUBLIC void uno_threadpool_dispose(uno_ThreadPool hPool) SAL_THROW_EXTERN_C()
All threads, that are waiting on the hPool handle, are forced out of the pool.
uno_threadpool_enter
CPPU_DLLPUBLIC void uno_threadpool_enter(uno_ThreadPool hPool, void **ppJob) SAL_THROW_EXTERN_C()
This method is called to wait for a reply of a previously sent request.
uno_getIdOfCurrentThread
CPPU_DLLPUBLIC void uno_getIdOfCurrentThread(sal_Sequence **ppThreadId) SAL_THROW_EXTERN_C()
Get the identifier of the current thread.
uno_ThreadPool
struct _uno_ThreadPool * uno_ThreadPool
Definition threadpool.h:78
uno_threadpool_putJob
CPPU_DLLPUBLIC void uno_threadpool_putJob(uno_ThreadPool hPool, sal_Sequence *pThreadId, void *pJob, void(*doRequest)(void *pThreadSpecificData), sal_Bool bIsOneway) SAL_THROW_EXTERN_C()
Puts a job into the pool.
uno_threadpool_detach
CPPU_DLLPUBLIC void uno_threadpool_detach(uno_ThreadPool hPool) SAL_THROW_EXTERN_C()
Detaches the current thread from the threadpool.
uno_bindIdToCurrentThread
CPPU_DLLPUBLIC sal_Bool uno_bindIdToCurrentThread(sal_Sequence *pThreadId) SAL_THROW_EXTERN_C()
Establishes an association between the current thread and the given thread identifier.
uno_threadpool_destroy
CPPU_DLLPUBLIC void uno_threadpool_destroy(uno_ThreadPool hPool) SAL_THROW_EXTERN_C()
Releases the previously with uno_threadpool_create() created handle.
uno_threadpool_attach
CPPU_DLLPUBLIC void uno_threadpool_attach(uno_ThreadPool hPool) SAL_THROW_EXTERN_C()
Makes the current thread known to the threadpool.
cppudllapi.h
CPPU_DLLPUBLIC
#define CPPU_DLLPUBLIC
Definition cppudllapi.h:13