OpenSolaris defines MUTEX_DEFAULT therefore we rename the members of the enums mutex/condvar/rwlock_type_t.

This commit is contained in:
Tobias Brunner 2009-08-14 13:30:59 +02:00
parent 8b6a5ce5ba
commit 3901937d14
41 changed files with 63 additions and 63 deletions

View File

@ -117,7 +117,7 @@ static entry_t *entry_create(listener_t *listener, bool blocker)
this->listener = listener;
this->blocker = blocker;
this->calling = 0;
this->condvar = condvar_create(CONDVAR_DEFAULT);
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
return this;
}
@ -760,7 +760,7 @@ bus_t *bus_create()
this->public.destroy = (void(*)(bus_t*)) destroy;
this->listeners = linked_list_create();
this->mutex = mutex_create(MUTEX_RECURSIVE);
this->mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
pthread_key_create(&this->thread_id, NULL);
pthread_key_create(&this->thread_sa, NULL);

View File

@ -260,7 +260,7 @@ attribute_manager_t *attribute_manager_create()
this->providers = linked_list_create();
this->handlers = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -438,7 +438,7 @@ backend_manager_t *backend_manager_create()
this->public.destroy = (void (*)(backend_manager_t*))destroy;
this->backends = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -663,7 +663,7 @@ peer_cfg_t *peer_cfg_create(char *name, u_int ike_version, ike_cfg_t *ike_cfg,
this->ike_version = ike_version;
this->ike_cfg = ike_cfg;
this->child_cfgs = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->cert_policy = cert_policy;
this->unique = unique;
this->keyingtries = keyingtries;

View File

@ -1591,7 +1591,7 @@ credential_manager_t *credential_manager_create()
this->cache = cert_cache_create();
this->cache_queue = linked_list_create();
this->sets->insert_first(this->sets, this->cache);
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -383,7 +383,7 @@ cert_cache_t *cert_cache_create()
this->relations[i].subject = NULL;
this->relations[i].issuer = NULL;
this->relations[i].hits = 0;
this->relations[i].lock = rwlock_create(RWLOCK_DEFAULT);
this->relations[i].lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
}
return &this->public;
}

View File

@ -139,9 +139,9 @@ sender_t * sender_create()
this->public.destroy = (void(*)(sender_t*)) destroy;
this->list = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->got = condvar_create(CONDVAR_DEFAULT);
this->sent = condvar_create(CONDVAR_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->got = condvar_create(CONDVAR_TYPE_DEFAULT);
this->sent = condvar_create(CONDVAR_TYPE_DEFAULT);
this->job = callback_job_create((callback_job_cb_t)send_packets,
this, NULL, NULL);

View File

@ -161,8 +161,8 @@ bool radius_client_init()
"charon.plugins.eap_radius.sockets", 1);
sockets = linked_list_create();
mutex = mutex_create(MUTEX_DEFAULT);
condvar = condvar_create(CONDVAR_DEFAULT);
mutex = mutex_create(MUTEX_TYPE_DEFAULT);
condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
for (i = 0; i < count; i++)
{
fd = socket(host->get_family(host), SOCK_DGRAM, IPPROTO_UDP);

View File

@ -251,7 +251,7 @@ eap_sim_file_triplets_t *eap_sim_file_triplets_create(char *file)
this->public.destroy = (void(*)(eap_sim_file_triplets_t*))destroy;
this->triplets = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
read_triplets(this, file);

View File

@ -2632,8 +2632,8 @@ kernel_klips_ipsec_t *kernel_klips_ipsec_create()
this->allocated_spis = linked_list_create();
this->installed_sas = linked_list_create();
this->ipsec_devices = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex_pfkey = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->mutex_pfkey = mutex_create(MUTEX_TYPE_DEFAULT);
this->install_routes = lib->settings->get_bool(lib->settings, "charon.install_routes", TRUE);
this->seq = 0;

View File

@ -1972,7 +1972,7 @@ kernel_netlink_ipsec_t *kernel_netlink_ipsec_create()
/* private members */
this->policies = hashtable_create((hashtable_hash_t)policy_hash,
(hashtable_equals_t)policy_equals, 32);
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->install_routes = lib->settings->get_bool(lib->settings,
"charon.install_routes", TRUE);

View File

@ -1370,8 +1370,8 @@ kernel_netlink_net_t *kernel_netlink_net_create()
/* private members */
this->ifaces = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->condvar = condvar_create(CONDVAR_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
timerclear(&this->last_roam);
this->routing_table = lib->settings->get_int(lib->settings,
"charon.routing_table", IPSEC_ROUTING_TABLE);

View File

@ -255,7 +255,7 @@ netlink_socket_t *netlink_socket_create(int protocol) {
/* private members */
this->seq = 200;
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
memset(&addr, 0, sizeof(addr));
addr.nl_family = AF_NETLINK;

View File

@ -2158,8 +2158,8 @@ kernel_pfkey_ipsec_t *kernel_pfkey_ipsec_create()
/* private members */
this->policies = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex_pfkey = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->mutex_pfkey = mutex_create(MUTEX_TYPE_DEFAULT);
this->install_routes = lib->settings->get_bool(lib->settings,
"charon.install_routes", TRUE);
this->seq = 0;

View File

@ -681,8 +681,8 @@ kernel_pfroute_net_t *kernel_pfroute_net_create()
/* private members */
this->ifaces = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex_pfroute = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->mutex_pfroute = mutex_create(MUTEX_TYPE_DEFAULT);
this->seq = 0;

View File

@ -202,8 +202,8 @@ plugin_t *plugin_create()
shutdown_on = this->iterations * this->initiators;
}
this->mutex = mutex_create(MUTEX_DEFAULT);
this->condvar = condvar_create(CONDVAR_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
this->config = load_tester_config_create();
this->creds = load_tester_creds_create();
this->listener = load_tester_listener_create(shutdown_on);

View File

@ -322,7 +322,7 @@ nm_creds_t *nm_creds_create()
this->public.clear = (void(*)(nm_creds_t*))clear;
this->public.destroy = (void(*)(nm_creds_t*))destroy;
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
this->cert = NULL;
this->user = NULL;

View File

@ -183,7 +183,7 @@ resolv_conf_handler_t *resolv_conf_handler_create()
this->public.handler.release = (void(*)(attribute_handler_t*, ike_sa_t*, configuration_attribute_type_t, chunk_t))release;
this->public.destroy = (void(*)(resolv_conf_handler_t*))destroy;
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->file = lib->settings->get_str(lib->settings,
"charon.plugins.resolv-conf.file", RESOLV_CONF);

View File

@ -539,7 +539,7 @@ stroke_attribute_t *stroke_attribute_create()
this->public.destroy = (void(*)(stroke_attribute_t*))destroy;
this->pools = linked_list_create();
this->mutex = mutex_create(MUTEX_RECURSIVE);
this->mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
return &this->public;
}

View File

@ -447,7 +447,7 @@ stroke_ca_t *stroke_ca_create(stroke_cred_t *cred)
this->public.destroy = (void(*)(stroke_ca_t*))destroy;
this->sections = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
this->cred = cred;
return &this->public;

View File

@ -924,7 +924,7 @@ stroke_config_t *stroke_config_create(stroke_ca_t *ca, stroke_cred_t *cred)
this->public.destroy = (void(*)(stroke_config_t*))destroy;
this->list = linked_list_create();
this->mutex = mutex_create(MUTEX_RECURSIVE);
this->mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
this->ca = ca;
this->cred = cred;

View File

@ -1125,7 +1125,7 @@ stroke_cred_t *stroke_cred_create()
this->certs = linked_list_create();
this->shared = linked_list_create();
this->private = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
load_certs(this);
load_secrets(this, SECRETS_FILE, 0);

View File

@ -65,7 +65,7 @@ bool test_mutex()
int i;
pthread_t threads[THREADS];
mutex = mutex_create(MUTEX_RECURSIVE);
mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
for (i = 0; i < 10; i++)
{

View File

@ -182,7 +182,7 @@ callback_job_t *callback_job_create(callback_job_cb_t cb, void *data,
this->public.cancel = (void(*)(callback_job_t*))cancel;
/* private variables */
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->callback = cb;
this->data = data;
this->cleanup = cleanup;

View File

@ -240,9 +240,9 @@ processor_t *processor_create(size_t pool_size)
this->public.destroy = (void(*)(processor_t*))destroy;
this->list = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->job_added = condvar_create(CONDVAR_DEFAULT);
this->thread_terminated = condvar_create(CONDVAR_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->job_added = condvar_create(CONDVAR_TYPE_DEFAULT);
this->thread_terminated = condvar_create(CONDVAR_TYPE_DEFAULT);
this->total_threads = 0;
this->desired_threads = 0;
this->idle_threads = 0;

View File

@ -347,8 +347,8 @@ scheduler_t * scheduler_create()
this->heap_size = HEAP_SIZE_DEFAULT;
this->heap = (event_t**)calloc(this->heap_size + 1, sizeof(event_t*));
this->mutex = mutex_create(MUTEX_DEFAULT);
this->condvar = condvar_create(CONDVAR_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
this->job = callback_job_create((callback_job_cb_t)schedule, this, NULL, NULL);
charon->processor->queue_job(charon->processor, (job_t*)this->job);

View File

@ -163,7 +163,7 @@ eap_manager_t *eap_manager_create()
this->public.destroy = (void(*)(eap_manager_t*))destroy;
this->methods = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -1568,7 +1568,7 @@ connect_manager_t *connect_manager_create()
this->checklists = linked_list_create();
this->initiated = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
return (connect_manager_t*)this;
}

View File

@ -133,7 +133,7 @@ static entry_t *entry_create()
entry_t *this = malloc_thing(entry_t);
this->waiting_threads = 0;
this->condvar = condvar_create(CONDVAR_DEFAULT);
this->condvar = condvar_create(CONDVAR_TYPE_DEFAULT);
/* we set checkout flag when we really give it out */
this->checked_out = FALSE;
@ -1711,7 +1711,7 @@ ike_sa_manager_t *ike_sa_manager_create()
this->segments = (segment_t*)calloc(this->segment_count, sizeof(segment_t));
for (i = 0; i < this->segment_count; ++i)
{
this->segments[i].mutex = mutex_create(MUTEX_RECURSIVE);
this->segments[i].mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
this->segments[i].count = 0;
}
@ -1720,7 +1720,7 @@ ike_sa_manager_t *ike_sa_manager_create()
this->half_open_segments = calloc(this->segment_count, sizeof(shareable_segment_t));
for (i = 0; i < this->segment_count; ++i)
{
this->half_open_segments[i].lock = rwlock_create(RWLOCK_DEFAULT);
this->half_open_segments[i].lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
this->half_open_segments[i].count = 0;
}
@ -1729,7 +1729,7 @@ ike_sa_manager_t *ike_sa_manager_create()
this->connected_peers_segments = calloc(this->segment_count, sizeof(shareable_segment_t));
for (i = 0; i < this->segment_count; ++i)
{
this->connected_peers_segments[i].lock = rwlock_create(RWLOCK_DEFAULT);
this->connected_peers_segments[i].lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
this->connected_peers_segments[i].count = 0;
}

View File

@ -331,7 +331,7 @@ mediation_manager_t *mediation_manager_create()
this->public.check_and_register = (ike_sa_id_t*(*)(mediation_manager_t*,identification_t*,identification_t*))check_and_register;
this->peers = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
return (mediation_manager_t*)this;
}

View File

@ -362,7 +362,7 @@ trap_manager_t *trap_manager_create()
this->public.destroy = (void(*)(trap_manager_t*))destroy;
this->traps = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
/* register listener for IKE state changes */
this->listener.traps = this;

View File

@ -234,7 +234,7 @@ credential_factory_t *credential_factory_create()
this->constructors = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -746,7 +746,7 @@ crypto_factory_t *crypto_factory_create()
this->prfs = linked_list_create();
this->rngs = linked_list_create();
this->dhs = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
this->tester = crypto_tester_create();
this->test_on_add = lib->settings->get_bool(lib->settings,
"libstrongswan.crypto_test.on_add", FALSE);

View File

@ -110,7 +110,7 @@ database_factory_t *database_factory_create()
this->public.destroy = (void(*)(database_factory_t*))destroy;
this->databases = linked_list_create();
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
return &this->public;
}

View File

@ -201,7 +201,7 @@ fetcher_manager_t *fetcher_manager_create()
this->public.destroy = (void(*)(fetcher_manager_t*))destroy;
this->fetchers = linked_list_create();
this->lock = rwlock_create(RWLOCK_DEFAULT);
this->lock = rwlock_create(RWLOCK_TYPE_DEFAULT);
return &this->public;
}

View File

@ -47,7 +47,7 @@ struct private_gcrypt_plugin_t {
*/
static int mutex_init(void **lock)
{
*lock = mutex_create(MUTEX_DEFAULT);
*lock = mutex_create(MUTEX_TYPE_DEFAULT);
return 0;
}

View File

@ -686,7 +686,7 @@ mysql_database_t *mysql_database_create(char *uri)
free(this);
return NULL;
}
this->mutex = mutex_create(MUTEX_DEFAULT);
this->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
this->pool = linked_list_create();
/* check connectivity */

View File

@ -84,7 +84,7 @@ static struct CRYPTO_dynlock_value *create_function(const char *file, int line)
struct CRYPTO_dynlock_value *lock;
lock = malloc_thing(struct CRYPTO_dynlock_value);
lock->mutex = mutex_create(MUTEX_DEFAULT);
lock->mutex = mutex_create(MUTEX_TYPE_DEFAULT);
return lock;
}
@ -140,7 +140,7 @@ static void threading_init()
mutex = malloc(sizeof(mutex_t*) * num_locks);
for (i = 0; i < num_locks; i++)
{
mutex[i] = mutex_create(MUTEX_DEFAULT);
mutex[i] = mutex_create(MUTEX_TYPE_DEFAULT);
}
}

View File

@ -333,7 +333,7 @@ sqlite_database_t *sqlite_database_create(char *uri)
this->public.db.get_driver = (db_driver_t(*)(database_t*))get_driver;
this->public.db.destroy = (void(*)(database_t*))destroy;
this->mutex = mutex_create(MUTEX_RECURSIVE);
this->mutex = mutex_create(MUTEX_TYPE_RECURSIVE);
if (sqlite3_open(file, &this->db) != SQLITE_OK)
{

View File

@ -276,7 +276,7 @@ mutex_t *mutex_create(mutex_type_t type)
{
switch (type)
{
case MUTEX_RECURSIVE:
case MUTEX_TYPE_RECURSIVE:
{
private_r_mutex_t *this = malloc_thing(private_r_mutex_t);
@ -292,7 +292,7 @@ mutex_t *mutex_create(mutex_type_t type)
return &this->generic.public;
}
case MUTEX_DEFAULT:
case MUTEX_TYPE_DEFAULT:
default:
{
private_mutex_t *this = malloc_thing(private_mutex_t);
@ -416,7 +416,7 @@ condvar_t *condvar_create(condvar_type_t type)
{
switch (type)
{
case CONDVAR_DEFAULT:
case CONDVAR_TYPE_DEFAULT:
default:
{
private_condvar_t *this = malloc_thing(private_condvar_t);
@ -488,7 +488,7 @@ rwlock_t *rwlock_create(rwlock_type_t type)
{
switch (type)
{
case RWLOCK_DEFAULT:
case RWLOCK_TYPE_DEFAULT:
default:
{
private_rwlock_t *this = malloc_thing(private_rwlock_t);

View File

@ -63,9 +63,9 @@ static inline int cancellable_recvfrom(int socket, void *buffer, size_t length,
*/
enum mutex_type_t {
/** default mutex */
MUTEX_DEFAULT = 0,
MUTEX_TYPE_DEFAULT = 0,
/** allow recursive locking of the mutex */
MUTEX_RECURSIVE = 1,
MUTEX_TYPE_RECURSIVE = 1,
};
/**
@ -73,7 +73,7 @@ enum mutex_type_t {
*/
enum condvar_type_t {
/** default condvar */
CONDVAR_DEFAULT = 0,
CONDVAR_TYPE_DEFAULT = 0,
};
/**
@ -81,7 +81,7 @@ enum condvar_type_t {
*/
enum rwlock_type_t {
/** default condvar */
RWLOCK_DEFAULT = 0,
RWLOCK_TYPE_DEFAULT = 0,
};
/**