Browse Source

Various fixes for NetBSD: enabled kevent support, workaround of pthreads shared RW lock

master
Artyom Beilis 9 years ago
parent
commit
8a130e2c72
4 changed files with 9 additions and 4 deletions
  1. +2
    -1
      CMakeLists.txt
  2. +1
    -1
      booster/lib/aio/src/reactor_config.h
  3. +2
    -2
      booster/lib/thread/src/pthread.cpp
  4. +4
    -0
      private/http_parser.h

+ 2
- 1
CMakeLists.txt View File

@@ -132,7 +132,8 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif()
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
message("Addign rdynamic")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -rdynamic")
endif()



+ 1
- 1
booster/lib/aio/src/reactor_config.h View File

@@ -20,7 +20,7 @@
# define AIO_HAVE_POLL
# define AIO_HAVE_POSIX_SELECT

#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__NetBSD__)

# define AIO_HAVE_KQUEUE
# define AIO_HAVE_POLL


+ 2
- 2
booster/lib/thread/src/pthread.cpp View File

@@ -152,7 +152,7 @@ namespace booster {
void shared_mutex::unique_lock() { pthread_rwlock_wrlock(&d->m); }
void shared_mutex::unlock() { pthread_rwlock_unlock(&d->m); }

#ifndef __APPLE__
#if !defined(__APPLE__) && !defined(__NetBSD__)
//
// This is normal implementation
//
@@ -257,7 +257,7 @@ namespace booster {
public:
pthread_key(void (*d)(void *)) : key(d)
{
if(pthread_key_create(&key_,booster_pthread_key_destroyer) < 0) {
if(pthread_key_create(&key_,booster_pthread_key_destroyer) != 0) {
throw system::system_error(errno,system::system_category,
"Failed to create thread specific key");
}


+ 4
- 0
private/http_parser.h View File

@@ -11,6 +11,10 @@
#include <vector>
#include <string>

#ifdef getc
#undef getc
#endif

namespace cppcms {
namespace http {
namespace impl {


Loading…
Cancel
Save