亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? test4.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*** 2003 December 18**** The author disclaims copyright to this source code.  In place of** a legal notice, here is a blessing:****    May you do good and not evil.**    May you find forgiveness for yourself and forgive others.**    May you share freely, never taking more than you give.***************************************************************************** Code for testing the the SQLite library in a multithreaded environment.**** $Id: test4.c,v 1.17 2006/02/23 21:43:56 drh Exp $*/#include "sqliteInt.h"#include "tcl.h"#include "os.h"#if defined(OS_UNIX) && OS_UNIX==1 && defined(THREADSAFE) && THREADSAFE==1#include <stdlib.h>#include <string.h>#include <pthread.h>#include <sched.h>#include <ctype.h>/*** Each thread is controlled by an instance of the following** structure.*/typedef struct Thread Thread;struct Thread {  /* The first group of fields are writable by the master and read-only  ** to the thread. */  char *zFilename;       /* Name of database file */  void (*xOp)(Thread*);  /* next operation to do */  char *zArg;            /* argument usable by xOp */  int opnum;             /* Operation number */  int busy;              /* True if this thread is in use */  /* The next group of fields are writable by the thread but read-only to the  ** master. */  int completed;        /* Number of operations completed */  sqlite3 *db;           /* Open database */  sqlite3_stmt *pStmt;     /* Pending operation */  char *zErr;           /* operation error */  char *zStaticErr;     /* Static error message */  int rc;               /* operation return code */  int argc;             /* number of columns in result */  const char *argv[100];    /* result columns */  const char *colv[100];    /* result column names */};/*** There can be as many as 26 threads running at once.  Each is named** by a capital letter: A, B, C, ..., Y, Z.*/#define N_THREAD 26static Thread threadset[N_THREAD];/*** The main loop for a thread.  Threads use busy waiting. */static void *thread_main(void *pArg){  Thread *p = (Thread*)pArg;  if( p->db ){    sqlite3_close(p->db);  }  sqlite3_open(p->zFilename, &p->db);  if( SQLITE_OK!=sqlite3_errcode(p->db) ){    p->zErr = strdup(sqlite3_errmsg(p->db));    sqlite3_close(p->db);    p->db = 0;  }  p->pStmt = 0;  p->completed = 1;  while( p->opnum<=p->completed ) sched_yield();  while( p->xOp ){    if( p->zErr && p->zErr!=p->zStaticErr ){      sqlite3_free(p->zErr);      p->zErr = 0;    }    (*p->xOp)(p);    p->completed++;    while( p->opnum<=p->completed ) sched_yield();  }  if( p->pStmt ){    sqlite3_finalize(p->pStmt);    p->pStmt = 0;  }  if( p->db ){    sqlite3_close(p->db);    p->db = 0;  }  if( p->zErr && p->zErr!=p->zStaticErr ){    sqlite3_free(p->zErr);    p->zErr = 0;  }  p->completed++;  sqlite3_thread_cleanup();  return 0;}/*** Get a thread ID which is an upper case letter.  Return the index.** If the argument is not a valid thread ID put an error message in** the interpreter and return -1.*/static int parse_thread_id(Tcl_Interp *interp, const char *zArg){  if( zArg==0 || zArg[0]==0 || zArg[1]!=0 || !isupper((unsigned char)zArg[0]) ){    Tcl_AppendResult(interp, "thread ID must be an upper case letter", 0);    return -1;  }  return zArg[0] - 'A';}/*** Usage:    thread_create NAME  FILENAME**** NAME should be an upper case letter.  Start the thread running with** an open connection to the given database.*/static int tcl_thread_create(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  pthread_t x;  int rc;  if( argc!=3 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID FILENAME", 0);    return TCL_ERROR;  }  i = parse_thread_id(interp, argv[1]);  if( i<0 ) return TCL_ERROR;  if( threadset[i].busy ){    Tcl_AppendResult(interp, "thread ", argv[1], " is already running", 0);    return TCL_ERROR;  }  threadset[i].busy = 1;  sqliteFree(threadset[i].zFilename);  threadset[i].zFilename = sqliteStrDup(argv[2]);  threadset[i].opnum = 1;  threadset[i].completed = 0;  rc = pthread_create(&x, 0, thread_main, &threadset[i]);  if( rc ){    Tcl_AppendResult(interp, "failed to create the thread", 0);    sqliteFree(threadset[i].zFilename);    threadset[i].busy = 0;    return TCL_ERROR;  }  pthread_detach(x);  return TCL_OK;}/*** Wait for a thread to reach its idle state.*/static void thread_wait(Thread *p){  while( p->opnum>p->completed ) sched_yield();}/*** Usage:  thread_wait ID**** Wait on thread ID to reach its idle state.*/static int tcl_thread_wait(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  if( argc!=2 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID", 0);    return TCL_ERROR;  }  i = parse_thread_id(interp, argv[1]);  if( i<0 ) return TCL_ERROR;  if( !threadset[i].busy ){    Tcl_AppendResult(interp, "no such thread", 0);    return TCL_ERROR;  }  thread_wait(&threadset[i]);  return TCL_OK;}/*** Stop a thread.*/static void stop_thread(Thread *p){  thread_wait(p);  p->xOp = 0;  p->opnum++;  thread_wait(p);  sqliteFree(p->zArg);  p->zArg = 0;  sqliteFree(p->zFilename);  p->zFilename = 0;  p->busy = 0;}/*** Usage:  thread_halt ID**** Cause a thread to shut itself down.  Wait for the shutdown to be** completed.  If ID is "*" then stop all threads.*/static int tcl_thread_halt(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  if( argc!=2 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID", 0);    return TCL_ERROR;  }  if( argv[1][0]=='*' && argv[1][1]==0 ){    for(i=0; i<N_THREAD; i++){      if( threadset[i].busy ) stop_thread(&threadset[i]);    }  }else{    i = parse_thread_id(interp, argv[1]);    if( i<0 ) return TCL_ERROR;    if( !threadset[i].busy ){      Tcl_AppendResult(interp, "no such thread", 0);      return TCL_ERROR;    }    stop_thread(&threadset[i]);  }  return TCL_OK;}/*** Usage: thread_argc  ID**** Wait on the most recent thread_step to complete, then return the** number of columns in the result set.*/static int tcl_thread_argc(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  char zBuf[100];  if( argc!=2 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID", 0);    return TCL_ERROR;  }  i = parse_thread_id(interp, argv[1]);  if( i<0 ) return TCL_ERROR;  if( !threadset[i].busy ){    Tcl_AppendResult(interp, "no such thread", 0);    return TCL_ERROR;  }  thread_wait(&threadset[i]);  sprintf(zBuf, "%d", threadset[i].argc);  Tcl_AppendResult(interp, zBuf, 0);  return TCL_OK;}/*** Usage: thread_argv  ID   N**** Wait on the most recent thread_step to complete, then return the** value of the N-th columns in the result set.*/static int tcl_thread_argv(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  int n;  if( argc!=3 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID N", 0);    return TCL_ERROR;  }  i = parse_thread_id(interp, argv[1]);  if( i<0 ) return TCL_ERROR;  if( !threadset[i].busy ){    Tcl_AppendResult(interp, "no such thread", 0);    return TCL_ERROR;  }  if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;  thread_wait(&threadset[i]);  if( n<0 || n>=threadset[i].argc ){    Tcl_AppendResult(interp, "column number out of range", 0);    return TCL_ERROR;  }  Tcl_AppendResult(interp, threadset[i].argv[n], 0);  return TCL_OK;}/*** Usage: thread_colname  ID   N**** Wait on the most recent thread_step to complete, then return the** name of the N-th columns in the result set.*/static int tcl_thread_colname(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */){  int i;  int n;  if( argc!=3 ){    Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],       " ID N", 0);    return TCL_ERROR;  }  i = parse_thread_id(interp, argv[1]);  if( i<0 ) return TCL_ERROR;  if( !threadset[i].busy ){    Tcl_AppendResult(interp, "no such thread", 0);    return TCL_ERROR;  }  if( Tcl_GetInt(interp, argv[2], &n) ) return TCL_ERROR;  thread_wait(&threadset[i]);  if( n<0 || n>=threadset[i].argc ){    Tcl_AppendResult(interp, "column number out of range", 0);    return TCL_ERROR;  }  Tcl_AppendResult(interp, threadset[i].colv[n], 0);  return TCL_OK;}/*** Usage: thread_result  ID**** Wait on the most recent operation to complete, then return the** result code from that operation.*/static int tcl_thread_result(  void *NotUsed,  Tcl_Interp *interp,    /* The TCL interpreter that invoked this command */  int argc,              /* Number of arguments */  const char **argv      /* Text of each argument */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本高清免费不卡视频| 精品一区二区三区的国产在线播放| 国产麻豆精品在线| 精品国产乱码久久久久久免费| 精品无人码麻豆乱码1区2区 | 日韩免费高清av| 日本中文在线一区| 精品福利视频一区二区三区| 国产精品亚洲成人| 亚洲日本韩国一区| 欧美日韩精品三区| 国产精品一二三区| 亚洲最大成人综合| 91精品国产一区二区三区| 久久激情五月婷婷| 中文字幕欧美国产| 在线欧美小视频| 美女网站色91| 国产精品久久久久aaaa樱花| 欧美偷拍一区二区| 国产一区二区三区四| 最新不卡av在线| 欧美一级二级在线观看| 成人不卡免费av| 婷婷久久综合九色国产成人| 久久天堂av综合合色蜜桃网| 91丨国产丨九色丨pron| 日韩综合小视频| 国产精品久久久久久久久快鸭| 欧美视频在线一区二区三区| 国产一区二区免费看| 一区二区三区影院| 久久综合色播五月| 欧美日韩在线播放三区四区| 国产一区二区美女| 丝袜诱惑制服诱惑色一区在线观看| 久久五月婷婷丁香社区| 欧美在线不卡视频| 成人美女视频在线看| 午夜精品影院在线观看| 国产精品福利一区| 久久综合九色综合欧美98| 在线观看成人免费视频| 国产精品66部| 美国欧美日韩国产在线播放| 亚洲日本电影在线| 欧美激情一区二区三区| 91精品福利在线一区二区三区| 91亚洲男人天堂| 国产电影一区二区三区| 美女尤物国产一区| 亚洲综合免费观看高清完整版 | 欧美精三区欧美精三区| 成人18精品视频| 激情久久久久久久久久久久久久久久| 亚洲激情中文1区| 亚洲国产成人自拍| 久久久天堂av| 欧美精品一区二区三区很污很色的| 欧美吻胸吃奶大尺度电影| 99riav久久精品riav| 国产成人av资源| 国产一区二区视频在线播放| 麻豆国产精品一区二区三区 | 日韩欧美一级二级三级久久久| 91啦中文在线观看| av电影在线观看一区| 高清不卡一二三区| 国内精品写真在线观看| 麻豆一区二区99久久久久| 日韩国产欧美视频| 日韩电影在线免费看| 亚洲成人7777| 亚洲电影你懂得| 亚洲成人tv网| 日韩黄色在线观看| 美女性感视频久久| 国内精品伊人久久久久影院对白| 久久精品国产99久久6| 日本午夜一本久久久综合| 婷婷综合另类小说色区| 午夜精品免费在线| 日韩av高清在线观看| 美女性感视频久久| 国产老肥熟一区二区三区| 国产在线视视频有精品| 国产激情视频一区二区在线观看| 国产精品1区2区| 丁香桃色午夜亚洲一区二区三区| 国产精品一区专区| 成人白浆超碰人人人人| 色狠狠综合天天综合综合| 欧洲色大大久久| 欧美一级片免费看| 国产亚洲欧洲一区高清在线观看| 亚洲国产精品激情在线观看| 中文字幕一区日韩精品欧美| 亚洲精品高清在线观看| 日本欧美一区二区三区乱码| 激情综合色丁香一区二区| 国产精品羞羞答答xxdd| 99久久国产综合精品色伊| 91激情五月电影| 日韩欧美成人一区二区| 国产精品午夜久久| 亚洲国产精品欧美一二99| 美日韩一区二区| 99久久精品国产毛片| 欧美一区在线视频| 国产视频911| 亚洲图片一区二区| 韩日av一区二区| 99久久精品免费观看| 制服丝袜av成人在线看| 国产三级精品视频| 亚洲综合激情另类小说区| 美国十次综合导航| 一本大道久久a久久精品综合| 日韩一区二区麻豆国产| 国产精品久久久久影视| 免费在线成人网| 色综合久久综合网97色综合| 欧美一区二区三区在线观看 | 久久久www成人免费无遮挡大片| 亚洲欧美日韩久久| 另类小说图片综合网| 97久久精品人人澡人人爽| 日韩三级中文字幕| 国产精品国产三级国产aⅴ中文 | 国产呦精品一区二区三区网站| 91在线观看一区二区| 亚洲精品一区二区三区精华液| 亚洲自拍偷拍av| 成人aa视频在线观看| 精品国产91乱码一区二区三区 | 亚洲免费观看高清完整版在线观看熊| 麻豆精品蜜桃视频网站| 色天天综合色天天久久| 国产亚洲综合在线| 看片的网站亚洲| 欧美性一级生活| 成人免费在线播放视频| 国产乱码精品1区2区3区| 欧美精品一二三| 一区二区三区在线免费观看| 国产成人免费视频精品含羞草妖精| 欧美一区二区三区视频在线观看| 一级精品视频在线观看宜春院 | 日韩欧美色综合| 日韩不卡手机在线v区| 欧美日韩中文国产| 亚洲老妇xxxxxx| av影院午夜一区| 国产亚洲欧美日韩日本| 国产在线观看一区二区| 欧美一区二区三区日韩视频| 亚洲成a人v欧美综合天堂| 日本道色综合久久| 亚洲激情一二三区| 色哟哟在线观看一区二区三区| 中文字幕日韩欧美一区二区三区| 高潮精品一区videoshd| 国产嫩草影院久久久久| 国产成人免费xxxxxxxx| 国产三级久久久| 成人的网站免费观看| 国产精品久久久久久一区二区三区 | 青青草一区二区三区| 91精品欧美福利在线观看| 日韩和欧美一区二区| 在线成人av网站| 琪琪久久久久日韩精品| 日韩一区二区三区在线视频| 青青草国产精品97视觉盛宴| 91精品国产一区二区三区| 久久精品国产成人一区二区三区| 精品久久久久久久久久久久包黑料| 免费在线观看成人| 精品国产91洋老外米糕| 国产成人免费视频网站| 1024成人网| 在线观看国产精品网站| 日韩激情在线观看| 2020国产精品久久精品美国| 国产精品1024| 中文字幕五月欧美| 欧美性大战xxxxx久久久| 午夜精品123| 久久久噜噜噜久噜久久综合| av成人免费在线| 亚洲超丰满肉感bbw| 精品久久久久久久一区二区蜜臀| 粉嫩高潮美女一区二区三区| 一区二区三区日本| 日韩午夜中文字幕| 成人99免费视频| 天天亚洲美女在线视频| 国产亚洲成年网址在线观看| 一本色道久久综合亚洲91| 日韩精品亚洲一区|