[Libreoffice-commits] .: salhelper/inc salhelper/Package_inc.mk sal/inc sal/Library_sal.mk sal/osl sal/Package_inc.mk sal/qa sal/util

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 4 03:39:18 PST 2012


 sal/Library_sal.mk                         |    2 
 sal/Package_inc.mk                         |    2 
 sal/inc/osl/semaphor.h                     |   91 --------------
 sal/inc/osl/semaphor.hxx                   |  120 -------------------
 sal/osl/unx/semaphor.c                     |  126 --------------------
 sal/osl/unx/system.c                       |   69 -----------
 sal/osl/unx/system.h                       |   25 ----
 sal/osl/w32/pipe.c                         |    1 
 sal/osl/w32/semaphor.c                     |  104 ----------------
 sal/qa/libs2test.txt                       |    1 
 sal/qa/osl/condition/osl_Condition_Const.h |    4 
 sal/util/sal.map                           |    5 
 salhelper/Package_inc.mk                   |    3 
 salhelper/inc/salhelper/future.hxx         |  114 ------------------
 salhelper/inc/salhelper/futurequeue.hxx    |  102 ----------------
 salhelper/inc/salhelper/queue.hxx          |  178 -----------------------------
 16 files changed, 947 deletions(-)

New commits:
commit d911673a64250ece50f6ca5578385adabcae5e5d
Author: Thorsten Behrens <tbehrens at suse.com>
Date:   Tue Dec 4 12:36:09 2012 +0100

    API CHANGE: remove long-deprecated Semaphore & related stuff.
    
    osl::semaphore was not portable & thusly long-deprecated. Also
    killing further unused clients of that code in salhelper.
    
    Change-Id: Ie1c1924e06e8ce3be33fd1dc2c6933f2de8b5217

diff --git a/sal/Library_sal.mk b/sal/Library_sal.mk
index 9c835ed..72234a9 100644
--- a/sal/Library_sal.mk
+++ b/sal/Library_sal.mk
@@ -188,7 +188,6 @@ $(eval $(call gb_Library_add_cobjects,sal,\
 	sal/osl/unx/profile \
 	sal/osl/unx/readwrite_helper \
 	sal/osl/unx/security \
-	sal/osl/unx/semaphor \
 	sal/osl/unx/socket \
 	sal/osl/unx/system \
 	sal/osl/unx/tempfile \
@@ -258,7 +257,6 @@ $(eval $(call gb_Library_add_cobjects,sal,\
 	sal/osl/w32/nlsupport \
 	sal/osl/w32/pipe \
 	sal/osl/w32/security \
-	sal/osl/w32/semaphor \
 	sal/osl/w32/thread \
 	sal/osl/w32/time \
 	sal/osl/w32/util \
diff --git a/sal/Package_inc.mk b/sal/Package_inc.mk
index bf17e5f..0e91e08 100644
--- a/sal/Package_inc.mk
+++ b/sal/Package_inc.mk
@@ -52,8 +52,6 @@ $(eval $(call gb_Package_add_file,sal_inc,inc/osl/profile.hxx,osl/profile.hxx))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/security_decl.hxx,osl/security_decl.hxx))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/security.h,osl/security.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/security.hxx,osl/security.hxx))
-$(eval $(call gb_Package_add_file,sal_inc,inc/osl/semaphor.h,osl/semaphor.h))
-$(eval $(call gb_Package_add_file,sal_inc,inc/osl/semaphor.hxx,osl/semaphor.hxx))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/signal.h,osl/signal.h))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/socket_decl.hxx,osl/socket_decl.hxx))
 $(eval $(call gb_Package_add_file,sal_inc,inc/osl/socket.h,osl/socket.h))
diff --git a/sal/inc/osl/semaphor.h b/sal/inc/osl/semaphor.h
deleted file mode 100644
index 9d46d7f..0000000
--- a/sal/inc/osl/semaphor.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#ifndef _OSL_SEMAPHORE_H_
-#define _OSL_SEMAPHORE_H_
-
-#include "sal/config.h"
-
-#include "sal/saldllapi.h"
-#include "sal/types.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef void* oslSemaphore;
-
-/** Creates a semaphore.<BR>
-
-    @deprecated
-    Must not be used, as unnamed semaphores are not supported on Mac OS X.
-
-    @param initialCount denotes the starting value the semaphore. If you set it to
-    zero, the first acquire() blocks. Otherwise InitialCount acquire()s  are
-    immedeatly  successfull.
-    @return 0 if the semaphore could not be created, otherwise a handle to the sem.
-*/
-SAL_DLLPUBLIC oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount);
-
-/** Release the OS-structures and free semaphore data-structure
-
-    @deprecated
-    Must not be used, as unnamed semaphores are not supported on Mac OS X.
-
-    @return fbbb
-*/
-SAL_DLLPUBLIC void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore);
-
-/** acquire() decreases the count. It will block if it tries to
-    decrease below zero.
-
-    @deprecated
-    Must not be used, as unnamed semaphores are not supported on Mac OS X.
-
-    @return False if the system-call failed.
-*/
-SAL_DLLPUBLIC sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore);
-
-/** tryToAcquire() tries to decreases the count. It will
-    return with False if it would decrease the count below zero.
-    (When acquire() would block.) If it could successfully
-    decrease the count, it will return True.
-
-    @deprecated
-    Must not be used, as unnamed semaphores are not supported on Mac OS X.
-*/
-SAL_DLLPUBLIC sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore);
-
-/** release() increases the count.
-
-    @deprecated
-    Must not be used, as unnamed semaphores are not supported on Mac OS X.
-
-    @return False if the system-call failed.
-*/
-SAL_DLLPUBLIC sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif  /* _OSL_SEMAPHORE_H_  */
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/inc/osl/semaphor.hxx b/sal/inc/osl/semaphor.hxx
deleted file mode 100644
index 155b7b8..0000000
--- a/sal/inc/osl/semaphor.hxx
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#ifndef _OSL_SEMAPHORE_HXX_
-#define _OSL_SEMAPHORE_HXX_
-
-#ifdef __cplusplus
-
-#include <osl/semaphor.h>
-
-
-namespace osl
-{
-    /** C++ wrapper class around C semaphore functions.
-
-        @deprecated
-        Must not be used, as unnamed semaphores are not supported on Mac OS X.
-    */
-    class Semaphore {
-
-    public:
-
-        /** Creates a semaphore.<BR>
-            @param initialCount denotes the starting value the semaphore. If you set it to
-            zero, the first acquire() blocks. Otherwise InitialCount acquire()s  are
-            immedeatly  successfull.
-            @return 0 if the semaphore could not be created, otherwise a handle to the sem.
-        */
-
-        Semaphore(sal_uInt32 initialCount)
-        {
-            semaphore = osl_createSemaphore(initialCount);
-        }
-
-        /** Release the OS-structures and free semaphore data-structure
-            @return fbbb
-        */
-        ~Semaphore()
-        {
-            osl_destroySemaphore(semaphore);
-        }
-
-        /** acquire() decreases the count. It will block if it tries to
-            decrease below zero.
-            @return False if the system-call failed.
-        */
-        sal_Bool acquire()
-        {
-            return osl_acquireSemaphore(semaphore);
-        }
-
-        /** tryToAcquire() tries to decreases the count. It will
-            return with False if it would decrease the count below zero.
-            (When acquire() would block.) If it could successfully
-            decrease the count, it will return True.
-        */
-        sal_Bool tryToAcquire()
-        {
-            return osl_tryToAcquireSemaphore(semaphore);
-        }
-
-        /** release() increases the count.
-            @return False if the system-call failed.
-        */
-        sal_Bool release()
-        {
-            return osl_releaseSemaphore(semaphore);
-        }
-
-    private:
-        oslSemaphore semaphore;
-
-        /** The underlying oslSemaphore has no reference count.
-
-        Since the underlying oslSemaphore is not a reference counted object, copy
-        constructed Semaphore may work on an already destructed oslSemaphore object.
-
-        */
-        Semaphore(const Semaphore&);
-
-        /** The underlying oslSemaphore has no reference count.
-
-        When destructed, the Semaphore object destroys the undelying oslSemaphore,
-        which might cause severe problems in case it's a temporary object.
-
-        */
-        Semaphore(oslSemaphore Semaphore);
-
-        /** This assignment operator is private for the same reason as
-            the copy constructor.
-        */
-        Semaphore& operator= (const Semaphore&);
-
-        /** This assignment operator is private for the same reason as
-            the constructor taking a oslSemaphore argument.
-        */
-        Semaphore& operator= (oslSemaphore);
-    };
-}
-
-#endif  /* __cplusplus */
-#endif  /* _OSL_SEMAPHORE_HXX_  */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/semaphor.c b/sal/osl/unx/semaphor.c
deleted file mode 100644
index bff843f..0000000
--- a/sal/osl/unx/semaphor.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-
-#include "system.h"
-
-#include <osl/semaphor.h>
-#include <osl/diagnose.h>
-
-/* This is the (default) POSIX thread-local semaphore variant */
-
-/*
-    Implemetation notes:
-    The void* represented by oslSemaphore is used
-    as a pointer to an sem_t struct
-*/
-
-/*****************************************************************************/
-/* osl_createSemaphore  */
-/*****************************************************************************/
-
-oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount)
-{
-    int ret = 0;
-    oslSemaphore Semaphore;
-
-    Semaphore= malloc(sizeof(sem_t));
-
-    OSL_ASSERT(Semaphore);      /* ptr valid? */
-
-    if ( Semaphore == 0 )
-    {
-        return 0;
-    }
-
-    /* unnamed semaphore, not shared between processes */
-
-       ret= sem_init((sem_t*)Semaphore, 0, initialCount);
-
-    /* create failed? */
-    if (ret != 0)
-    {
-        OSL_TRACE("osl_createSemaphore failed. Errno: %d; %s\n",
-                  errno,
-                  strerror(errno));
-
-        free(Semaphore);
-        Semaphore = NULL;
-    }
-
-    return Semaphore;
-}
-
-/*****************************************************************************/
-/* osl_destroySemaphore  */
-/*****************************************************************************/
-void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore)
-{
-    if(Semaphore)           /* ptr valid? */
-    {
-        sem_destroy((sem_t*)Semaphore);
-        free(Semaphore);
-    }
-}
-
-/*****************************************************************************/
-/* osl_acquireSemaphore  */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore) {
-
-    OSL_ASSERT(Semaphore != 0); /* abort in debug mode */
-
-    if (Semaphore != 0)     /* be tolerant in release mode */
-    {
-        return (sem_wait((sem_t*)Semaphore) == 0);
-    }
-
-    return sal_False;
-}
-
-/*****************************************************************************/
-/* osl_tryToAcquireSemaphore  */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore) {
-
-    OSL_ASSERT(Semaphore != 0); /* abort in debug mode */
-    if (Semaphore != 0)     /* be tolerant in release mode */
-    {
-        return (sem_trywait((sem_t*)Semaphore) == 0);
-    }
-
-    return sal_False;
-}
-
-/*****************************************************************************/
-/* osl_releaseSemaphore  */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore) {
-
-    OSL_ASSERT(Semaphore != 0);     /* abort in debug mode */
-
-    if (Semaphore != 0)         /* be tolerant in release mode */
-    {
-        return (sem_post((sem_t*)Semaphore) == 0);
-    }
-
-    return sal_False;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c
index fca7655..8c8280d 100644
--- a/sal/osl/unx/system.c
+++ b/sal/osl/unx/system.c
@@ -207,75 +207,6 @@ int macxp_resolveAlias(char *path, int buflen)
 
 #endif /* NO_PTHREAD_RTL */
 
-#ifdef NO_PTHREAD_SEMAPHORES
-int sem_init(sem_t* sem, int pshared, unsigned int value)
-{
-    (void)pshared;
-    pthread_mutex_init(&sem->mutex, PTHREAD_MUTEXATTR_DEFAULT);
-    pthread_cond_init(&sem->increased, PTHREAD_CONDATTR_DEFAULT);
-
-    sem->value = (int)value;
-    return 0;
-}
-
-int sem_destroy(sem_t* sem)
-{
-    pthread_mutex_destroy(&sem->mutex);
-    pthread_cond_destroy(&sem->increased);
-    sem->value = 0;
-    return 0;
-}
-
-int sem_wait(sem_t* sem)
-{
-    pthread_mutex_lock(&sem->mutex);
-
-    while (sem->value <= 0)
-    {
-        pthread_cond_wait(&sem->increased, &sem->mutex);
-    }
-
-    sem->value--;
-    pthread_mutex_unlock(&sem->mutex);
-
-    return 0;
-}
-
-int sem_trywait(sem_t* sem)
-{
-    int result = 0;
-
-    pthread_mutex_lock(&sem->mutex);
-
-    if (sem->value > 0)
-    {
-        sem->value--;
-    }
-    else
-    {
-        errno = EAGAIN;
-        result = -1;
-    }
-
-    pthread_mutex_unlock(&sem->mutex);
-
-    return result;
-}
-
-int sem_post(sem_t* sem)
-{
-    pthread_mutex_lock(&sem->mutex);
-
-    sem->value++;
-
-    pthread_mutex_unlock(&sem->mutex);
-
-    pthread_cond_signal(&sem->increased);
-
-    return 0;
-}
-#endif
-
 #if defined(FREEBSD)
 char *fcvt(double value, int ndigit, int *decpt, int *sign)
 {
diff --git a/sal/osl/unx/system.h b/sal/osl/unx/system.h
index 8d7e734..057257e 100644
--- a/sal/osl/unx/system.h
+++ b/sal/osl/unx/system.h
@@ -73,7 +73,6 @@
 #   include <dlfcn.h>
 #   include <endian.h>
 #   include <sys/time.h>
-#   include <semaphore.h>
 #   if __BYTE_ORDER == __LITTLE_ENDIAN
 #       define _LITTLE_ENDIAN
 #   elif __BYTE_ORDER == __BIG_ENDIAN
@@ -103,7 +102,6 @@
 #   include <dlfcn.h>
 #   include <endian.h>
 #   include <sys/time.h>
-#   include <semaphore.h>
 #   define  IORESOURCE_TRANSFER_BSD
 #   define  IOCHANNEL_TRANSFER_BSD_RENO
 #   define  pthread_testcancel()
@@ -118,7 +116,6 @@
 #   define  ETIME ETIMEDOUT
 #   include <pthread.h>
 #   include <sys/sem.h>
-#   include <semaphore.h>
 #   include <dlfcn.h>
 #   include <sys/filio.h>
 #   include <sys/ioctl.h>
@@ -148,7 +145,6 @@
 #   define  ETIME ETIMEDOUT
 #   include <pthread.h>
 #   include <sys/sem.h>
-#   include <semaphore.h>
 #   include <dlfcn.h>
 #   include <sys/filio.h>
 #   include <sys/ioctl.h>
@@ -173,7 +169,6 @@
 #   define  ETIME ETIMEDOUT
 #   include <pthread.h>
 #   include <sys/sem.h>
-#   include <semaphore.h>
 #   include <dlfcn.h>
 #   include <sys/filio.h>
 #   include <sys/ioctl.h>
@@ -208,7 +203,6 @@
 #   endif
 #   define  SLEEP_TIMESPEC(timespec)    nsleep(&timespec, 0)
 #   define  LIBPATH "LIBPATH"
-#   define  NO_PTHREAD_SEMAPHORES
 #endif
 
 #ifdef SOLARIS
@@ -216,7 +210,6 @@
 #   include <sys/un.h>
 #   include <stropts.h>
 #   include <pthread.h>
-#   include <semaphore.h>
 #   include <netinet/tcp.h>
 #   include <sys/filio.h>
 #   include <dlfcn.h>
@@ -243,7 +236,6 @@
 #   include <netinet/tcp.h>
 #   include <machine/endian.h>
 #   include <sys/time.h>
-#   include <sys/semaphore.h>
 /* fixme are premac and postmac still needed here? */
 #   include <premac.h>
 #   include <mach-o/dyld.h>
@@ -283,7 +275,6 @@ int macxp_resolveAlias(char *path, int buflen);
 #   include <netinet/tcp.h>
 #   include <machine/endian.h>
 #   include <sys/time.h>
-#   include <sys/semaphore.h>
 #   if BYTE_ORDER == LITTLE_ENDIAN
 #       ifndef _LITTLE_ENDIAN
 #       define _LITTLE_ENDIAN
@@ -403,22 +394,6 @@ typedef struct sockaddr_ipx {
 
 /* END HACK */
 
-#ifdef NO_PTHREAD_SEMAPHORES
-
-typedef struct
-{
-    pthread_mutex_t mutex;
-    pthread_cond_t  increased;
-    int             value;
-} sem_t;
-extern int sem_init(sem_t* sem, int pshared, unsigned int value);
-extern int sem_destroy(sem_t* sem);
-extern int sem_wait(sem_t* sem);
-extern int sem_trywait(sem_t* sem);
-extern int sem_post(sem_t* sem);
-
-#endif
-
 #ifdef NO_PTHREAD_RTL
 #if !defined FREEBSD || (__FreeBSD_version < 500112)
 #if !defined NETBSD
diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c
index 62125b9..149de07 100644
--- a/sal/osl/w32/pipe.c
+++ b/sal/osl/w32/pipe.c
@@ -25,7 +25,6 @@
 #include <osl/diagnose.h>
 #include <osl/thread.h>
 #include <osl/mutex.h>
-#include <osl/semaphor.h>
 #include <osl/conditn.h>
 #include <osl/interlck.h>
 #include <osl/process.h>
diff --git a/sal/osl/w32/semaphor.c b/sal/osl/w32/semaphor.c
deleted file mode 100644
index de3828b..0000000
--- a/sal/osl/w32/semaphor.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#include "system.h"
-
-#include <osl/diagnose.h>
-#include <osl/semaphor.h>
-
-/*
-    Implemetation notes:
-    The void* represented by oslSemaphore is used
-    to store a WIN32 HANDLE.
-*/
-
-
-/*****************************************************************************/
-/* osl_createSemaphore */
-/*****************************************************************************/
-oslSemaphore SAL_CALL osl_createSemaphore(sal_uInt32 initialCount)
-{
-    oslSemaphore Semaphore;
-
-    Semaphore= CreateSemaphore(0, initialCount, INT_MAX, 0);
-
-    /* create failed? */
-    if((HANDLE)Semaphore == INVALID_HANDLE_VALUE)
-    {
-        Semaphore= 0;
-    }
-
-    return Semaphore;
-}
-
-/*****************************************************************************/
-/* osl_destroySemaphore */
-/*****************************************************************************/
-void SAL_CALL osl_destroySemaphore(oslSemaphore Semaphore)
-{
-
-
-    if(Semaphore != 0)
-    {
-        CloseHandle((HANDLE)Semaphore);
-    }
-
-}
-
-/*****************************************************************************/
-/* osl_acquireSemaphore */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_acquireSemaphore(oslSemaphore Semaphore)
-{
-    OSL_ASSERT(Semaphore != 0);
-
-    switch ( WaitForSingleObject( (HANDLE)Semaphore, INFINITE ) )
-    {
-        case WAIT_OBJECT_0:
-            return sal_True;
-
-        default:
-            return (sal_False);
-    }
-}
-
-/*****************************************************************************/
-/* osl_tryToAcquireSemaphore */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_tryToAcquireSemaphore(oslSemaphore Semaphore)
-{
-    OSL_ASSERT(Semaphore != 0);
-    return (sal_Bool)(WaitForSingleObject((HANDLE)Semaphore, 0) == WAIT_OBJECT_0);
-}
-
-
-/*****************************************************************************/
-/* osl_releaseSemaphore */
-/*****************************************************************************/
-sal_Bool SAL_CALL osl_releaseSemaphore(oslSemaphore Semaphore)
-{
-    OSL_ASSERT(Semaphore != 0);
-
-    /* increase count by one, not interested in previous count */
-    return (sal_Bool)(ReleaseSemaphore((HANDLE)Semaphore, 1, NULL) != FALSE);
-}
-
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sal/qa/libs2test.txt b/sal/qa/libs2test.txt
index 2f8a01f..d41bf06 100644
--- a/sal/qa/libs2test.txt
+++ b/sal/qa/libs2test.txt
@@ -53,7 +53,6 @@ osl/socket    ; osl_AcceptorSocket
 
 osl/mutex     ; osl_Mutex
 osl/pipe      ; osl_Pipe
-osl/semaphore ; osl_Semaphore
 osl/condition ; osl_Condition
 osl/module    ; osl_Module
 osl/security  ; osl_Security
diff --git a/sal/qa/osl/condition/osl_Condition_Const.h b/sal/qa/osl/condition/osl_Condition_Const.h
index 9443ec3..6101914 100644
--- a/sal/qa/osl/condition/osl_Condition_Const.h
+++ b/sal/qa/osl/condition/osl_Condition_Const.h
@@ -29,10 +29,6 @@
 #include <osl/mutex.hxx>
 #include <osl/pipe.hxx>
 
-#ifndef _OSL_SEMAPHOR_HXX_
-#include <osl/semaphor.hxx>
-#endif
-
 #ifndef _OSL_CONDITION_HXX_
 #include <osl/conditn.hxx>
 #endif
diff --git a/sal/util/sal.map b/sal/util/sal.map
index 3c5e787..47dfe39 100644
--- a/sal/util/sal.map
+++ b/sal/util/sal.map
@@ -25,7 +25,6 @@ UDK_3_0_0 {
         osl_acquireSocket;
         osl_acquirePipe;
         osl_acquireMutex;
-        osl_acquireSemaphore;
         osl_addSignalHandler;
         osl_addToSocketSet;
         osl_assertFailedLine;
@@ -47,7 +46,6 @@ UDK_3_0_0 {
         osl_createInetSocketAddr;
         osl_createMutex;
         osl_createPipe;
-        osl_createSemaphore;
         osl_createSocket;
         osl_createSocketSet;
         osl_createSuspendedThread;
@@ -58,7 +56,6 @@ UDK_3_0_0 {
         osl_destroyCondition;
         osl_destroyHostAddr;
         osl_destroyMutex;
-        osl_destroySemaphore;
         osl_destroySocketAddr;
         osl_destroySocketSet;
         osl_destroyThread;
@@ -144,7 +141,6 @@ UDK_3_0_0 {
         osl_releaseDirectoryItem;
         osl_releaseMutex;
         osl_releasePipe;
-        osl_releaseSemaphore;
         osl_releaseSocket;
         osl_removeFromSocketSet;
         osl_removeProfileEntry;
@@ -173,7 +169,6 @@ UDK_3_0_0 {
         osl_terminateThread;
         osl_trace;
         osl_tryToAcquireMutex;
-        osl_tryToAcquireSemaphore;
         osl_unloadModule;
         osl_waitCondition;
         osl_waitThread;
diff --git a/salhelper/Package_inc.mk b/salhelper/Package_inc.mk
index 4950c69..7a30c7f 100644
--- a/salhelper/Package_inc.mk
+++ b/salhelper/Package_inc.mk
@@ -30,10 +30,7 @@ $(eval $(call gb_Package_Package,salhelper_inc,$(SRCDIR)/salhelper/inc/salhelper
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/salhelperdllapi.h,salhelperdllapi.h))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/condition.hxx,condition.hxx))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/dynload.hxx,dynload.hxx))
-$(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/future.hxx,future.hxx))
-$(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/futurequeue.hxx,futurequeue.hxx))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/linkhelper.hxx,linkhelper.hxx))
-$(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/queue.hxx,queue.hxx))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/refobj.hxx,refobj.hxx))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/simplereferenceobject.hxx,simplereferenceobject.hxx))
 $(eval $(call gb_Package_add_file,salhelper_inc,inc/salhelper/singletonref.hxx,singletonref.hxx))
diff --git a/salhelper/inc/salhelper/future.hxx b/salhelper/inc/salhelper/future.hxx
deleted file mode 100644
index 0b97fd1..0000000
--- a/salhelper/inc/salhelper/future.hxx
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#ifndef _SALHELPER_FUTURE_HXX_
-#define _SALHELPER_FUTURE_HXX_
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/conditn.hxx>
-#include <salhelper/refobj.hxx>
-
-namespace salhelper
-{
-
-//----------------------------------------------------------------------------
-
-#ifndef SALHELPER_COPYCTOR_API
-#define SALHELPER_COPYCTOR_API(C) C (const C&); C& operator= (const C&)
-#endif
-
-//----------------------------------------------------------------------------
-
-template<class value_type>
-class FutureValue : protected osl::Condition
-{
-    /** Representation.
-     */
-    value_type m_aValue;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(FutureValue<value_type>);
-
-public:
-    inline FutureValue (const value_type& value = value_type()) SAL_THROW(())
-        : m_aValue (value)
-    {
-        Condition::reset();
-    }
-
-    inline ~FutureValue() SAL_THROW(())
-    {}
-
-    inline sal_Bool is() const SAL_THROW(())
-    {
-        return const_cast<FutureValue*>(this)->check();
-    }
-
-    inline void set (const value_type& value) SAL_THROW(())
-    {
-        m_aValue = value;
-        Condition::set();
-    }
-
-    inline value_type& get() SAL_THROW(())
-    {
-        Condition::wait();
-        return m_aValue;
-    }
-};
-
-//----------------------------------------------------------------------------
-
-template<class value_type>
-class Future : public salhelper::ReferenceObject
-{
-    /** Representation.
-     */
-    FutureValue<value_type> m_aValue;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(Future<value_type>);
-
-public:
-    inline Future (const value_type& value = value_type()) SAL_THROW(())
-        : m_aValue (value)
-    {}
-
-    inline void set (const value_type& value) SAL_THROW(())
-    {
-        OSL_PRECOND(!m_aValue.is(), "Future::set(): value already set");
-        m_aValue.set (value);
-    }
-
-    inline value_type& get() SAL_THROW(())
-    {
-        return m_aValue.get();
-    }
-};
-
-//----------------------------------------------------------------------------
-
-} // namespace salhelper
-
-#endif /* !_SALHELPER_FUTURE_HXX_ */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/salhelper/inc/salhelper/futurequeue.hxx b/salhelper/inc/salhelper/futurequeue.hxx
deleted file mode 100644
index c54a6a3..0000000
--- a/salhelper/inc/salhelper/futurequeue.hxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#ifndef _SALHELPER_FUTUREQUEUE_HXX_
-#define _SALHELPER_FUTUREQUEUE_HXX_
-
-#include <sal/types.h>
-#include <rtl/ref.hxx>
-#include <osl/mutex.hxx>
-#include <salhelper/future.hxx>
-#include <salhelper/queue.hxx>
-
-namespace salhelper
-{
-
-//----------------------------------------------------------------------------
-
-#ifndef SALHELPER_COPYCTOR_API
-#define SALHELPER_COPYCTOR_API(C) C (const C&); C& operator= (const C&)
-#endif
-
-//----------------------------------------------------------------------------
-
-template<class element_type>
-class FutureQueue : protected osl::Mutex
-{
-    /** Representation.
-     */
-    typedef salhelper::Future<element_type> future_type;
-
-    salhelper::QueueBase< rtl::Reference<future_type> > m_aDelayed;
-    salhelper::QueueBase< rtl::Reference<future_type> > m_aPresent;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(FutureQueue<element_type>);
-
-public:
-    /** Construction.
-     */
-    inline FutureQueue()
-    {}
-
-    /** Destruction.
-     */
-    inline ~FutureQueue()
-    {}
-
-    /** Enqueue element at queue tail.
-     */
-    inline void put (const element_type& element)
-    {
-        osl::MutexGuard aGuard (*this);
-
-        rtl::Reference<future_type> xFuture (m_aDelayed.get());
-        if (!xFuture.is())
-        {
-            xFuture = new future_type();
-            m_aPresent.put (xFuture);
-        }
-        xFuture->set (element);
-    }
-
-    /** Dequeue a future to element at queue head.
-     */
-    inline rtl::Reference< salhelper::Future<element_type> > get()
-    {
-        osl::MutexGuard aGuard (*this);
-
-        rtl::Reference<future_type> xFuture (m_aPresent.get());
-        if (!xFuture.is())
-        {
-            xFuture = new future_type();
-            m_aDelayed.put (xFuture);
-        }
-        return (xFuture);
-    }
-};
-
-//----------------------------------------------------------------------------
-
-} // namespace salhelper
-
-#endif /* !_SALHELPER_FUTUREQUEUE */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/salhelper/inc/salhelper/queue.hxx b/salhelper/inc/salhelper/queue.hxx
deleted file mode 100644
index 444b09f..0000000
--- a/salhelper/inc/salhelper/queue.hxx
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you 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 .
- */
-
-#ifndef _SALHELPER_QUEUE_HXX_
-#define _SALHELPER_QUEUE_HXX_
-
-#include <sal/types.h>
-#include <osl/diagnose.h>
-#include <osl/mutex.hxx>
-#include <osl/semaphor.hxx>
-
-#ifndef __LIST__
-#include <list>
-#endif
-
-namespace salhelper
-{
-
-//----------------------------------------------------------------------------
-
-#ifndef SALHELPER_COPYCTOR_API
-#define SALHELPER_COPYCTOR_API(C) C (const C&); C& operator= (const C&)
-#endif
-
-//----------------------------------------------------------------------------
-
-template<class element_type>
-class QueueBase : protected std::list<element_type>
-{
-    /** Representation.
-     */
-    osl::Mutex m_aMutex;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(QueueBase<element_type>);
-
-public:
-    inline QueueBase()
-    {}
-
-    inline ~QueueBase()
-    {
-        erase (this->begin(), this->end());
-    }
-
-    inline void put (const element_type& element)
-    {
-        osl::MutexGuard aGuard (m_aMutex);
-        push_back (element);
-    }
-
-    inline element_type get()
-    {
-        element_type element;
-
-        osl::MutexGuard aGuard (m_aMutex);
-        if (!this->empty())
-        {
-            element = this->front();
-            this->pop_front();
-        }
-
-        return (element);
-    }
-};
-
-//----------------------------------------------------------------------------
-
-/** Queue.
-
-    @deprecated
-    Must not be used, as it internally uses unnamed semaphores, which are not
-    supported on Mac OS X.
-*/
-template<class element_type>
-class Queue : protected QueueBase<element_type>
-{
-    /** Representation.
-     */
-    osl::Semaphore m_aNotEmpty;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(Queue<element_type>);
-
-public:
-    inline Queue() : m_aNotEmpty (static_cast< sal_uInt32 >(0))
-    {}
-
-    inline ~Queue()
-    {}
-
-    inline void put (const element_type& element)
-    {
-        QueueBase<element_type>::put (element);
-        m_aNotEmpty.release();
-    }
-
-    inline element_type get()
-    {
-        element_type element;
-
-        m_aNotEmpty.acquire();
-        element = QueueBase<element_type>::get();
-
-        return (element);
-    }
-};
-
-//----------------------------------------------------------------------------
-
-/** Bounded queue.
-
-    @deprecated
-    Must not be used, as it internally uses unnamed semaphores, which are not
-    supported on Mac OS X.
-*/
-template<class element_type>
-class BoundedQueue : protected Queue<element_type>
-{
-    /** Representation.
-     */
-    osl::Semaphore m_aNotFull;
-
-    /** Not implemented.
-     */
-    SALHELPER_COPYCTOR_API(BoundedQueue<element_type>);
-
-public:
-    inline BoundedQueue (sal_uInt32 capacity) : m_aNotFull (capacity)
-    {
-        OSL_POSTCOND(capacity, "BoundedQueue:BoundedQueue(): no capacity");
-    }
-
-    inline ~BoundedQueue()
-    {}
-
-    inline void put (const element_type& element)
-    {
-        m_aNotFull.acquire();
-        Queue<element_type>::put (element);
-    }
-
-    inline element_type get()
-    {
-        element_type element;
-
-        element = Queue<element_type>::get();
-        m_aNotFull.release();
-
-        return (element);
-    }
-};
-
-//----------------------------------------------------------------------------
-
-} // namespace salhelper
-
-#endif /* !_SALHELPER_QUEUE_HXX_ */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list