#include "miracle_connection.h"
#include "miracle_local.h"
#include "miracle_log.h"
+#include "miracle_commands.h"
#include <valerie/valerie_remote.h>
#include <valerie/valerie_tokeniser.h>
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 )
{
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;
}
}
}
return error;
}
+/** Fetch a units properties
+*/
+
+mlt_properties miracle_server_fetch_unit( miracle_server server, int index )
+{
+ miracle_unit unit = miracle_get_unit( index );
+ return unit != NULL ? unit->properties : NULL;
+}
+
/** Shutdown the server.
*/