X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmiracle%2Fmiracle_server.c;h=30182af7135a4f960cd3362d4d3cdc132183b6ae;hb=ee523db03a44cbda4b5def55e0c36427ab6a0747;hp=151ce3189ba94044fb44df45836fab2da7e81151;hpb=6ff05de8e70fc55abfdec249c277cccc9ef02b4d;p=melted diff --git a/src/miracle/miracle_server.c b/src/miracle/miracle_server.c index 151ce31..30182af 100644 --- a/src/miracle/miracle_server.c +++ b/src/miracle/miracle_server.c @@ -1,5 +1,5 @@ /* - * miracle_server.c -- DV Server + * miracle_server.c * Copyright (C) 2002-2003 Ushodaya Enterprises Limited * Author: Charles Yates * @@ -148,7 +148,7 @@ static void *miracle_server_run( void *arg ) pthread_t cmd_parse_info; connection_t *tmp = NULL; pthread_attr_t thread_attributes; - int socksize; + socklen_t socksize; socksize = sizeof( struct sockaddr ); @@ -158,9 +158,6 @@ static void *miracle_server_run( void *arg ) their resources get freed automatically. (CY: ... hmmph...) */ pthread_attr_init( &thread_attributes ); pthread_attr_setdetachstate( &thread_attributes, PTHREAD_CREATE_DETACHED ); - pthread_attr_init( &thread_attributes ); - pthread_attr_setinheritsched( &thread_attributes, PTHREAD_INHERIT_SCHED ); - /* pthread_attr_setschedpolicy( &thread_attributes, SCHED_RR ); */ while ( !server->shutdown ) { @@ -267,25 +264,13 @@ int miracle_server_execute( miracle_server server ) if ( response != NULL ) { - pthread_attr_t attr; int result; - pthread_attr_init( &attr ); - pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); - pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); - pthread_attr_setschedpolicy( &attr, SCHED_FIFO ); - pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); valerie_response_close( response ); - result = pthread_create( &server->thread, &attr, miracle_server_run, server ); + result = pthread_create( &server->thread, NULL, miracle_server_run, server ); if ( result ) { - miracle_log( LOG_WARNING, "Failed to schedule realtime (%s)", strerror(errno) ); - pthread_attr_setschedpolicy( &attr, SCHED_OTHER ); - result = pthread_create( &server->thread, &attr, miracle_server_run, server ); - if ( result ) - { - miracle_log( LOG_CRIT, "Failed to launch TCP listener thread" ); - error = -1; - } + miracle_log( LOG_CRIT, "Failed to launch TCP listener thread" ); + error = -1; } } }