OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [compile/] [20040708-1.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
/* PR rtl-optimization/16199 */
2
/* Origin: Olaf Klein <oklein@smallo.ruhr.de> */
3
 
4
typedef enum {
5
    APR_LOCK_FCNTL,
6
    APR_LOCK_FLOCK,
7
    APR_LOCK_SYSVSEM,
8
    APR_LOCK_PROC_PTHREAD,
9
    APR_LOCK_POSIXSEM,
10
    APR_LOCK_DEFAULT
11
} apr_lockmech_e;
12
 
13
struct apr_proc_mutex_unix_lock_methods_t {
14
    unsigned int flags;
15
    const char *name;
16
};
17
 
18
typedef struct apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_lock_methods_t;
19
 
20
extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods;
21
 
22
struct apr_proc_mutex_t {
23
    const apr_proc_mutex_unix_lock_methods_t *inter_meth;
24
    int curr_locked;
25
    char *fname;
26
};
27
 
28
typedef struct apr_proc_mutex_t apr_proc_mutex_t;
29
 
30
extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_proc_pthread_methods;
31
 
32
extern const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods;
33
 
34
static int proc_mutex_choose_method(apr_proc_mutex_t *new_mutex, apr_lockmech_e mech)
35
{
36
    switch (mech) {
37
    case APR_LOCK_FCNTL:
38
        new_mutex->inter_meth = &apr_proc_mutex_unix_fcntl_methods;
39
        break;
40
    case APR_LOCK_FLOCK:
41
        return ((20000 + 50000) + 23);
42
        break;
43
    case APR_LOCK_SYSVSEM:
44
        new_mutex->inter_meth = &apr_proc_mutex_unix_sysv_methods;
45
        break;
46
    case APR_LOCK_POSIXSEM:
47
        return ((20000 + 50000) + 23);
48
        break;
49
    case APR_LOCK_PROC_PTHREAD:
50
        new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods;
51
        break;
52
    case APR_LOCK_DEFAULT:
53
        new_mutex->inter_meth = &apr_proc_mutex_unix_proc_pthread_methods;
54
        break;
55
    default:
56
        return ((20000 + 50000) + 23);
57
    }
58
    return 0;
59
}
60
 
61
const char* apr_proc_mutex_defname(void)
62
{
63
    apr_proc_mutex_t mutex;
64
 
65
    if (proc_mutex_choose_method(&mutex, APR_LOCK_DEFAULT) != 0) {
66
        return "unknown";
67
    }
68
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.