if test "$xfs" = "yes" ; then
echo "CONFIG_XFS=y" >> $config_host_mak
fi
-
-# for qemu_thread_create call in tizen
-echo "CONFIG_THREAD=y" >> $config_host_mak
-
qemu_version=`head $source_path/VERSION`
echo "VERSION=$qemu_version" >>$config_host_mak
echo "PKGVERSION=$pkgversion" >>$config_host_mak
{
int sock;
fd_set active_fd_set, read_fd_set;
- sigset_t set, oldset;
+
socklen_t size;
#ifndef _WIN32
continue;
}
-
- /* Leave signal handling to the iothread. */
- sigfillset(&set);
- pthread_sigmask(SIG_SETMASK, &set, &oldset);
if( pthread_create( (pthread_t *)&taskid, NULL, (void *(*)(void *))OGLS_loop, (void *)pConn ) )
{
- pthread_sigmask(SIG_SETMASK, &oldset, NULL);
perror( "pthread_create" );
OGLS_removeConn( pConn );
continue;
}
- pthread_sigmask(SIG_SETMASK, &oldset, NULL);
}
closesocket( sock );
#include <sys/shm.h>
#endif
-#include "qemu-thread.h"
#include "opengl_server.h"
#include "sdb.h"
#include "nbd.h"
#endif
#ifdef ENABLE_OPENGL_SERVER
-QemuThread thread_opengl_id;
+pthread_t thread_opengl_id;
#endif /* ENABLE_OPENGL_SERVER */
#ifndef _WIN32
INFO( "Emulator Stop: shutdown qemu system, gtk_main quit complete \n");
#ifdef ENABLE_OPENGL_SERVER
- pthread_cancel(thread_opengl_id.thread);
+ pthread_cancel(thread_opengl_id);
INFO( "opengl_server thread is quited.\n");
#endif /* ENABLE_OPENGL_SERVER */
// If user selects 'Yes' in Power off poup, 'qemu_system_shutdown_request' in vl.c is supposed to be called.
/* 2nd way : send command shutdown to emuld in guest image */
- QemuThread thread;
-
- qemu_thread_create(&thread, graceful_shutdown_ftn, NULL);
+ pthread_t thread_id;
+ if (pthread_create(&thread_id, NULL, graceful_shutdown_ftn, NULL) != 0) {
+ ERR("pthread_create fail \n");
+ qemu_system_shutdown_request();
+ }
#else
INFO( "Emulator Stop: shutdown qemu system, gtk_main quit complete \n");
#ifdef ENABLE_OPENGL_SERVER
- pthread_cancel(thread_opengl_id.thread);
+ pthread_cancel(thread_opengl_id);
INFO( "opengl_server thread is quited.\n");
#endif /* ENABLE_OPENGL_SERVER */
int i, r;
- QemuThread thread;
+ pthread_t thread_gtk_id;
init_emulator(&argc, &argv);
startup_option_parser(&argc, &argv);
register_sig_handler();
#ifndef _WIN32
-
construct_main_window();
/* 5.3 create gtk thread */
- qemu_thread_create(&thread, run_gtk_main, NULL);
-
+ if (pthread_create(&thread_gtk_id, NULL, run_gtk_main, NULL) != 0) {
+ ERR( "error creating gtk_id thread!!\n");
+ return -1;
+ }
#else /* _WIN32 */
-
/* if _WIN32, window creation and gtk main must be run in a thread */
- qemu_thread_create(&thread, construct_main_window_and_run_gtk_main, NULL);
-
+ if (pthread_create(&thread_gtk_id, NULL, construct_main_window_and_run_gtk_main, NULL) != 0) {
+ ERR( "error creating gtk_id thread!!\n");
+ return -1;
+ }
#endif
#ifdef ENABLE_OPENGL_SERVER
-
/* create OPENGL server thread */
- qemu_thread_create(&thread_opengl_id, init_opengl_server, NULL);
-
+ if (pthread_create(&thread_opengl_id, NULL, init_opengl_server, NULL) != 0) {
+ ERR( "error creating opengl_id thread!!");
+ return -1;
+ }
#endif /* ENABLE_OPENGL_SERVER */
/* 6. create serial console and vmodem, and other processes */
#include "utils.h"
#include <pthread.h>
-#include "qemu-thread.h"
#include "debug_ch.h"
#include "../ui/sdl_rotate.h"
#ifdef SDL_THREAD
if(sdl_thread_initialized == 0 ){
sdl_thread_initialized = 1;
- QemuThread thread_id;
+ pthread_t thread_id;
TRACE( "sdl update thread create \n");
- qemu_thread_create(&thread_id, run_qemu_update, NULL);
+ if (pthread_create(&thread_id, NULL, run_qemu_update, NULL) != 0) {
+ ERR( "pthread_create fail \n");
+ return;
+ }
}
#endif
}
#include <pthread.h>
#include <math.h>
-#include "qemu-thread.h"
#include "sensor_server.h"
#include "emulator.h"
#define UDP
return 1;
}
+#if 0
+/* Not using sdb port forwarding => Using redir in sdb setup */
+static void *create_fw_rota_init(void *arg)
+{
+ int s;
+ int tries = 0;
+ char fw_buf[64] = {0};
+ char recv_buf[8] = {0};
+ char send_buf[32] = {0};
+
+ while(1)
+ {
+ s = tcp_socket_outgoing("127.0.0.1", SDB_HOST_PORT);
+ if (s < 0) {
+
+ ERR("[%d] can't create socket to talk to the SDB server \n", ++tries);
+ usleep(1000000);
+
+ if(tries > 9)
+ break;
+ else
+ continue;
+ }
+
+ memset(fw_buf, 0, sizeof(fw_buf));
+
+ /* length is hex: 0x35 = 53 */
+ sprintf(fw_buf,"0035host-serial:emulator-%d:forward:tcp:%d;tcp:3577"
+ ,get_sdb_base_port(), get_sdb_base_port() + SDB_TCP_SENSOR_INDEX );
+
+ /* Over 53+4 */
+ socket_send(s, fw_buf, 60);
+
+ memset(recv_buf, 0, sizeof(recv_buf));
+ recv( s, recv_buf, 4, 0 );
+
+ /* check OKAY */
+ if(!memcmp(recv_buf, "OKAY", 4)) {
+ INFO( "create forward [%s] success : [%s] \n", fw_buf, recv_buf);
+
+ /* send init ratation info */
+ sprintf(send_buf, "1\n3\n0\n-9.80665\n0\n");
+
+ if( send_info_to_sensor_daemon(send_buf, 32) <= 0 ) {
+ ERR( "[%s][%d] send init rotaion info: error \n", __FUNCTION__, __LINE__);
+ }else{
+ INFO( "[%s][%d] send init rotation info: sucess \n", __FUNCTION__, __LINE__);
+ /* all initialized */
+ sensord_initialized = 1;
+ }
+
+ break;
+ }else{
+ /* not ready */
+ //fprintf(stderr, "create forward [%s] fail : [%s] \n", fw_buf, recv_buf);
+ usleep(1000000);
+ }
+
+#ifdef __WIN32
+ closesocket(s);
+#else
+ close(s);
+#endif
+
+ }
+
+ return NULL;
+}
+#endif
+
gboolean sensor_server(GIOChannel *channel, GIOCondition condition, gpointer data)
{
int parse_result;
{
parse_result = sensor_parser(recv_buf);
+#if 0
+ /* Not using sdb forwarding => Using redir in sdb setup */
+ if(sent_start_value == 0) {
+
+ /* new way with sdb */
+ pthread_t taskid;
+
+ INFO( "pthread_create for create_forward : \n");
+ if( pthread_create( (pthread_t *)&taskid, NULL, (void *(*)(void *))create_fw_rota_init, NULL ) ){
+ ERR( "pthread_create for create_forward fail: \n");
+ }
+
+ sent_start_value = 1;
+ }
+#endif
+
if(sensord_initialized)
{
switch(parse_result)