Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/clib/cfathread.cfa

    ra0a949c r95dab9e  
    1616// #define EPOLL_FOR_SOCKETS
    1717
    18 #include <string.h>
    19 
    2018#include "fstream.hfa"
    2119#include "locks.hfa"
     
    2523#include "time.hfa"
    2624#include "stdlib.hfa"
    27 #include "iofwd.hfa"
     25
    2826#include "cfathread.h"
     27
     28extern "C" {
     29                #include <string.h>
     30                #include <errno.h>
     31}
    2932
    3033extern void ?{}(processor &, const char[], cluster &, thread$ *);
    3134extern "C" {
    32         extern void __cfactx_invoke_thread(void (*main)(void *), void * this);
     35      extern void __cfactx_invoke_thread(void (*main)(void *), void * this);
     36        extern int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags);
    3337}
    3438
     
    435439        // Mutex
    436440        struct cfathread_mutex {
    437                 exp_backoff_then_block_lock impl;
     441                linear_backoff_then_block_lock impl;
    438442        };
    439443        int cfathread_mutex_init(cfathread_mutex_t *restrict mut, const cfathread_mutexattr_t *restrict) __attribute__((nonnull (1))) { *mut = new(); return 0; }
     
    450454        // Condition
    451455        struct cfathread_condition {
    452                 condition_variable(exp_backoff_then_block_lock) impl;
     456                condition_variable(linear_backoff_then_block_lock) impl;
    453457        };
    454458        int cfathread_cond_init(cfathread_cond_t *restrict cond, const cfathread_condattr_t *restrict) __attribute__((nonnull (1))) { *cond = new(); return 0; }
     
    468472}
    469473
     474#include <iofwd.hfa>
     475
    470476extern "C" {
     477        #include <unistd.h>
     478        #include <sys/types.h>
     479        #include <sys/socket.h>
     480
    471481        //--------------------
    472482        // IO operations
     
    478488                , protocol);
    479489        }
    480         int cfathread_bind(int socket, __CONST_SOCKADDR_ARG address, socklen_t address_len) {
     490        int cfathread_bind(int socket, const struct sockaddr *address, socklen_t address_len) {
    481491                return bind(socket, address, address_len);
    482492        }
     
    486496        }
    487497
    488         int cfathread_accept(int socket, __SOCKADDR_ARG address, socklen_t *restrict address_len) {
     498        int cfathread_accept(int socket, struct sockaddr *restrict address, socklen_t *restrict address_len) {
    489499                #if defined(EPOLL_FOR_SOCKETS)
    490500                        int ret;
     
    503513        }
    504514
    505         int cfathread_connect(int socket, __CONST_SOCKADDR_ARG address, socklen_t address_len) {
     515        int cfathread_connect(int socket, const struct sockaddr *address, socklen_t address_len) {
    506516                #if defined(EPOLL_FOR_SOCKETS)
    507517                        int ret;
Note: See TracChangeset for help on using the changeset viewer.