src/actors.c
pthread_t actor_start(struct actor *self)
{
	struct addr_entry *entry = malloc(sizeof(*entry));
	struct cds_lfht_node *ret_node;
	pthread_t thread;
	int ret;

	assert_perror(errno);
	assert(entry);
	assert(self->addr);

	entry->key = self->addr;
	entry->actor = self;
	cds_lfht_node_init(&entry->node);

	/* TODO: Thread cancellation and cleanup */
	/* TODO: Set parent actor */
        ret = pthread_create(&self->thread, NULL, actor_start_routine, self);
	assert_perror(ret);
	thread = self->thread;

	rcu_read_lock();
	ret_node = cds_lfht_add_unique(book, entry->key, addr_entry_match,
				       &entry->key, &entry->node);
	assert(ret_node == &entry->node);
	rcu_read_unlock();

	return thread;
}
/* Starts the passed actor's thread and adds it to the book.
 *
 * Takes ownership of the passed actor. Returns the new thread. Note that once
 * an actor is started it may free itself (although it does call
 * synchronize_rcu() before free()).
 */
Starts the passed actor's thread and adds it to the book.
Takes ownership of the passed actor. Returns the new thread. Note that once
an actor is started it may free itself (although it does call
synchronize_rcu() before free()).
Starts the passed actor ' s thread and adds it to the book . Takes ownership of the passed actor . Returns the new thread . Note that once an actor is started it may free itself ( although it does call synchronize_rcu () before free () ) .
pthread_t actor_start(struct actor *self)
{
	struct addr_entry *entry = malloc(sizeof(*entry));
	struct cds_lfht_node *ret_node;
	pthread_t thread;
	int ret;
	assert_perror(errno);
	assert(entry);
	assert(self->addr);
	entry->key = self->addr;
	entry->actor = self;
	cds_lfht_node_init(&entry->node);
        ret = pthread_create(&self->thread, NULL, actor_start_routine, self);
	assert_perror(ret);
	thread = self->thread;
	rcu_read_lock();
	ret_node = cds_lfht_add_unique(book, entry->key, addr_entry_match,
				       &entry->key, &entry->node);
	assert(ret_node == &entry->node);
	rcu_read_unlock();
	return thread;
}
pthread_t actor_start ( struct actor * self ) { struct addr_entry * entry = malloc ( sizeof ( * entry ) ) ; struct cds_lfht_node * ret_node ; pthread_t thread ; int ret ; assert_perror ( errno ) ; assert ( entry ) ; assert ( self -> addr ) ; entry -> key = self -> addr ; entry -> actor = self ; cds_lfht_node_init ( & entry -> node ) ; ret = pthread_create ( & self -> thread , NULL , actor_start_routine , self ) ; assert_perror ( ret ) ; thread = self -> thread ; rcu_read_lock ( ) ; ret_node = cds_lfht_add_unique ( book , entry -> key , addr_entry_match , & entry -> key , & entry -> node ) ; assert ( ret_node == & entry -> node ) ; rcu_read_unlock ( ) ; return thread ; }
Starts the passed actor's thread and adds it to the book.
Starts the passed actor ' s thread and adds it to the book .
/* TODO: Thread cancellation and cleanup */ /* TODO: Set parent actor */