[33036] | 1 | /* $Id: RTSemEventWaitNoResume-2-ex-generic.cpp 98103 2023-01-17 14:15:46Z vboxsync $ */
|
---|
| 2 | /** @file
|
---|
| 3 | * IPRT - RTSemEventWaitNoResume, generic implementation based
|
---|
| 4 | * on RTSemEventWaitEx.
|
---|
| 5 | */
|
---|
| 6 |
|
---|
| 7 | /*
|
---|
[98103] | 8 | * Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
[33036] | 9 | *
|
---|
[96407] | 10 | * This file is part of VirtualBox base platform packages, as
|
---|
| 11 | * available from https://www.virtualbox.org.
|
---|
[33036] | 12 | *
|
---|
[96407] | 13 | * This program is free software; you can redistribute it and/or
|
---|
| 14 | * modify it under the terms of the GNU General Public License
|
---|
| 15 | * as published by the Free Software Foundation, in version 3 of the
|
---|
| 16 | * License.
|
---|
| 17 | *
|
---|
| 18 | * This program is distributed in the hope that it will be useful, but
|
---|
| 19 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
| 21 | * General Public License for more details.
|
---|
| 22 | *
|
---|
| 23 | * You should have received a copy of the GNU General Public License
|
---|
| 24 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
| 25 | *
|
---|
[33036] | 26 | * The contents of this file may alternatively be used under the terms
|
---|
| 27 | * of the Common Development and Distribution License Version 1.0
|
---|
[96407] | 28 | * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
| 29 | * in the VirtualBox distribution, in which case the provisions of the
|
---|
[33036] | 30 | * CDDL are applicable instead of those of the GPL.
|
---|
| 31 | *
|
---|
| 32 | * You may elect to license modified versions of this file under the
|
---|
| 33 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
[96407] | 34 | *
|
---|
| 35 | * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
[33036] | 36 | */
|
---|
| 37 |
|
---|
| 38 |
|
---|
[57358] | 39 | /*********************************************************************************************************************************
|
---|
| 40 | * Header Files *
|
---|
| 41 | *********************************************************************************************************************************/
|
---|
[33036] | 42 | #define LOG_GROUP RTLOGGROUP_SEM
|
---|
[36190] | 43 | #define RTSEMEVENT_WITHOUT_REMAPPING
|
---|
[33036] | 44 | #include <iprt/semaphore.h>
|
---|
| 45 | #include "internal/iprt.h"
|
---|
| 46 |
|
---|
[76452] | 47 | #include <iprt/errcore.h>
|
---|
[33036] | 48 | #include <iprt/assert.h>
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, RTMSINTERVAL cMillies)
|
---|
| 52 | {
|
---|
| 53 | int rc;
|
---|
| 54 | if (cMillies == RT_INDEFINITE_WAIT)
|
---|
| 55 | rc = RTSemEventWaitEx(hEventSem, RTSEMWAIT_FLAGS_NORESUME | RTSEMWAIT_FLAGS_INDEFINITE, 0);
|
---|
| 56 | else
|
---|
| 57 | rc = RTSemEventWaitEx(hEventSem,
|
---|
| 58 | RTSEMWAIT_FLAGS_NORESUME | RTSEMWAIT_FLAGS_RELATIVE | RTSEMWAIT_FLAGS_MILLISECS,
|
---|
| 59 | cMillies);
|
---|
| 60 | return rc;
|
---|
| 61 | }
|
---|
| 62 | RT_EXPORT_SYMBOL(RTSemEventWaitNoResume);
|
---|
| 63 |
|
---|