Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/sqlite/src/ext/async/sqlite3async.c

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/sqlite/src/configure.ac ('k') | third_party/sqlite/src/ext/fts1/fts1.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** 2005 December 14 2 ** 2005 December 14
3 ** 3 **
4 ** The author disclaims copyright to this source code. In place of 4 ** The author disclaims copyright to this source code. In place of
5 ** a legal notice, here is a blessing: 5 ** a legal notice, here is a blessing:
6 ** 6 **
7 ** May you do good and not evil. 7 ** May you do good and not evil.
8 ** May you find forgiveness for yourself and forgive others. 8 ** May you find forgiveness for yourself and forgive others.
9 ** May you share freely, never taking more than you give. 9 ** May you share freely, never taking more than you give.
10 ** 10 **
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 ** Process events on the write-queue. 1629 ** Process events on the write-queue.
1630 */ 1630 */
1631 void sqlite3async_run(void){ 1631 void sqlite3async_run(void){
1632 asyncWriterThread(); 1632 asyncWriterThread();
1633 } 1633 }
1634 1634
1635 /* 1635 /*
1636 ** Control/configure the asynchronous IO system. 1636 ** Control/configure the asynchronous IO system.
1637 */ 1637 */
1638 int sqlite3async_control(int op, ...){ 1638 int sqlite3async_control(int op, ...){
1639 int rc = SQLITE_OK;
1639 va_list ap; 1640 va_list ap;
1640 va_start(ap, op); 1641 va_start(ap, op);
1641 switch( op ){ 1642 switch( op ){
1642 case SQLITEASYNC_HALT: { 1643 case SQLITEASYNC_HALT: {
1643 int eWhen = va_arg(ap, int); 1644 int eWhen = va_arg(ap, int);
1644 if( eWhen!=SQLITEASYNC_HALT_NEVER 1645 if( eWhen!=SQLITEASYNC_HALT_NEVER
1645 && eWhen!=SQLITEASYNC_HALT_NOW 1646 && eWhen!=SQLITEASYNC_HALT_NOW
1646 && eWhen!=SQLITEASYNC_HALT_IDLE 1647 && eWhen!=SQLITEASYNC_HALT_IDLE
1647 ){ 1648 ){
1648 return SQLITE_MISUSE; 1649 rc = SQLITE_MISUSE;
1650 break;
1649 } 1651 }
1650 async.eHalt = eWhen; 1652 async.eHalt = eWhen;
1651 async_mutex_enter(ASYNC_MUTEX_QUEUE); 1653 async_mutex_enter(ASYNC_MUTEX_QUEUE);
1652 async_cond_signal(ASYNC_COND_QUEUE); 1654 async_cond_signal(ASYNC_COND_QUEUE);
1653 async_mutex_leave(ASYNC_MUTEX_QUEUE); 1655 async_mutex_leave(ASYNC_MUTEX_QUEUE);
1654 break; 1656 break;
1655 } 1657 }
1656 1658
1657 case SQLITEASYNC_DELAY: { 1659 case SQLITEASYNC_DELAY: {
1658 int iDelay = va_arg(ap, int); 1660 int iDelay = va_arg(ap, int);
1659 if( iDelay<0 ){ 1661 if( iDelay<0 ){
1660 return SQLITE_MISUSE; 1662 rc = SQLITE_MISUSE;
1663 break;
1661 } 1664 }
1662 async.ioDelay = iDelay; 1665 async.ioDelay = iDelay;
1663 break; 1666 break;
1664 } 1667 }
1665 1668
1666 case SQLITEASYNC_LOCKFILES: { 1669 case SQLITEASYNC_LOCKFILES: {
1667 int bLock = va_arg(ap, int); 1670 int bLock = va_arg(ap, int);
1668 async_mutex_enter(ASYNC_MUTEX_QUEUE); 1671 async_mutex_enter(ASYNC_MUTEX_QUEUE);
1669 if( async.nFile || async.pQueueFirst ){ 1672 if( async.nFile || async.pQueueFirst ){
1670 async_mutex_leave(ASYNC_MUTEX_QUEUE); 1673 async_mutex_leave(ASYNC_MUTEX_QUEUE);
1671 return SQLITE_MISUSE; 1674 rc = SQLITE_MISUSE;
1675 break;
1672 } 1676 }
1673 async.bLockFiles = bLock; 1677 async.bLockFiles = bLock;
1674 async_mutex_leave(ASYNC_MUTEX_QUEUE); 1678 async_mutex_leave(ASYNC_MUTEX_QUEUE);
1675 break; 1679 break;
1676 } 1680 }
1677 1681
1678 case SQLITEASYNC_GET_HALT: { 1682 case SQLITEASYNC_GET_HALT: {
1679 int *peWhen = va_arg(ap, int *); 1683 int *peWhen = va_arg(ap, int *);
1680 *peWhen = async.eHalt; 1684 *peWhen = async.eHalt;
1681 break; 1685 break;
1682 } 1686 }
1683 case SQLITEASYNC_GET_DELAY: { 1687 case SQLITEASYNC_GET_DELAY: {
1684 int *piDelay = va_arg(ap, int *); 1688 int *piDelay = va_arg(ap, int *);
1685 *piDelay = async.ioDelay; 1689 *piDelay = async.ioDelay;
1686 break; 1690 break;
1687 } 1691 }
1688 case SQLITEASYNC_GET_LOCKFILES: { 1692 case SQLITEASYNC_GET_LOCKFILES: {
1689 int *piDelay = va_arg(ap, int *); 1693 int *piDelay = va_arg(ap, int *);
1690 *piDelay = async.bLockFiles; 1694 *piDelay = async.bLockFiles;
1691 break; 1695 break;
1692 } 1696 }
1693 1697
1694 default: 1698 default:
1695 return SQLITE_ERROR; 1699 rc = SQLITE_ERROR;
1700 break;
1696 } 1701 }
1697 return SQLITE_OK; 1702 va_end(ap);
1703 return rc;
1698 } 1704 }
1699 1705
1700 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) */ 1706 #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_ASYNCIO) */
1701 1707
OLDNEW
« no previous file with comments | « third_party/sqlite/src/configure.ac ('k') | third_party/sqlite/src/ext/fts1/fts1.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698