// ------------------------------------------------------------------------------ // Read Thread // ------------------------------------------------------------------------------ void Autopilot_Interface::start_read_thread() { if (reading_status != 0) { fprintf(stderr, "read thread already running\n"); return; } else { read_thread(); return; } }
// read data thread void * read_data_thread(void *opaque){ media_handle_union_t * media_handle= (media_handle_union_t *)opaque; if (media_handle == NULL) { log_chris(ANDROID_LOG_ERROR ,TAG ,"media handle is null ,in read_data_thread"); return; } log_chris(ANDROID_LOG_ERROR ,TAG ,"==##in read_data_cb"); read_thread((int)media_handle); //to read the media data log_chris(ANDROID_LOG_ERROR ,TAG ,"==##read_data thread exit"); }
void LogMonitor::OnBnClickedButtonLogReset() { // TODO: Add your control notification handler code here // if (t!=null && t.IsAlive) // t.Abort(); // dd_list = new SortedList<string, downloaderdriver>(); // //dd_list.Clear(); // t = new Thread(new ThreadStart(this.ThreadRead)); // t.Start(); // listBox1.Items.Clear(); boost::thread read_thread(boost::bind(&LogMonitor::ReadThread, this)); read_thread.join(); }
inline bool PBFParser::Parse() { // Start the read and parse threads std::thread read_thread(std::bind(&PBFParser::ReadData, this)); // Open several parse threads that are synchronized before call to std::thread parse_thread(std::bind(&PBFParser::ParseData, this)); // Wait for the threads to finish read_thread.join(); parse_thread.join(); return true; }
int load_macho( const char *image_name ) { load_command_t cmd; mach_header_t hd; int i, pos, fd; if( (fd=open(image_name, O_RDONLY)) < 0 ) fatal_err("opening %s", image_name ); if( !is_macho(fd) ) { close( fd ); return 1; } if( read(fd, &hd, sizeof(hd)) != sizeof(hd) ) fatal("failed to read Mach-O header"); pos = sizeof(hd); for( i=0; i<hd.ncmds; i++, pos+=cmd.cmdsize ) { if( pread(fd, &cmd, sizeof(cmd), pos) != sizeof(cmd) ) break; lseek( fd, pos, SEEK_SET ); if( cmd.cmd == LC_SYMTAB ) continue; /* printm("\nLoad-CMD [%d]: %ld\n", i, cmd.cmd ); */ switch( cmd.cmd ) { case LC_SEGMENT: read_segment( fd ); break; case LC_THREAD: case LC_UNIXTHREAD: read_thread( fd ); break; } } close( fd ); return 0; }
/* * Class: com_chris_yanlong_player * Method: decode_thread * Signature: (I[BLjava/lang/Integer;Ljava/lang/Double;)I */ JNIEXPORT jint JNICALL Java_com_chris_yanlong_PlayerView_read_1thread (JNIEnv *env, jobject obj, jint handle ){ read_thread((int)handle ); }