LibreOffice
LibreOffice 5.4 SDK C/C++ API Reference
conditn.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 #ifndef INCLUDED_OSL_CONDITN_H
21 #define INCLUDED_OSL_CONDITN_H
22 
23 #include <sal/config.h>
24 
25 #include <osl/time.h>
26 #include <sal/saldllapi.h>
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 typedef void* oslCondition;
33 
34 typedef enum {
35  osl_cond_result_ok, /* successful completion */
36  osl_cond_result_error, /* error occurred, check osl_getLastSocketError() for details */
37  osl_cond_result_timeout, /* blocking operation timed out */
40 
49 SAL_DLLPUBLIC oslCondition SAL_CALL osl_createCondition(void);
50 
54 SAL_DLLPUBLIC void SAL_CALL osl_destroyCondition(oslCondition Condition);
55 
61 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_setCondition(oslCondition Condition);
62 
67 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_resetCondition(oslCondition Condition);
68 
76 SAL_DLLPUBLIC oslConditionResult SAL_CALL osl_waitCondition(oslCondition Condition, const TimeValue* pTimeout);
77 
83 SAL_DLLPUBLIC sal_Bool SAL_CALL osl_checkCondition(oslCondition Condition);
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif // INCLUDED_OSL_CONDITN_H
90 
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPUBLIC sal_Bool osl_setCondition(oslCondition Condition)
Sets condition to True => wait() will not block, check() returns True.
Definition: conditn.h:37
SAL_DLLPUBLIC oslConditionResult osl_waitCondition(oslCondition Condition, const TimeValue *pTimeout)
Blocks if condition is not set If condition has been destroyed prematurely, wait() will return with F...
void * oslCondition
Definition: conditn.h:32
Definition: time.h:66
oslConditionResult
Definition: conditn.h:34
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
SAL_DLLPUBLIC sal_Bool osl_resetCondition(oslCondition Condition)
Sets condition to False => wait() will block, check() returns False.
SAL_DLLPUBLIC void osl_destroyCondition(oslCondition Condition)
Free the memory used by the condition.
SAL_DLLPUBLIC oslCondition osl_createCondition(void)
Creates a condition.
Definition: conditn.h:38
unsigned char sal_Bool
Definition: types.h:39
Definition: conditn.h:36
Definition: conditn.h:35
#define SAL_MAX_ENUM
Definition: types.h:228
SAL_DLLPUBLIC sal_Bool osl_checkCondition(oslCondition Condition)
Queries the state of the condition without blocking.