本文整理汇总了C#中Community.CsharpSqlite.sqlite3_mutex类的典型用法代码示例。如果您正苦于以下问题:C# sqlite3_mutex类的具体用法?C# sqlite3_mutex怎么用?C# sqlite3_mutex使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
sqlite3_mutex类属于Community.CsharpSqlite命名空间,在下文中一共展示了sqlite3_mutex类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: counterMutexAlloc
/*
** Allocate a countable mutex
*/
static sqlite3_mutex counterMutexAlloc( int eType )
{
sqlite3_mutex pReal;
sqlite3_mutex pRet = null;
Debug.Assert( g.isInit );
Debug.Assert( eType < 8 && eType >= 0 );
pReal = g.m.xMutexAlloc( eType );
if ( null == pReal )
return null;
if ( eType == SQLITE_MUTEX_FAST || eType == SQLITE_MUTEX_RECURSIVE )
{
pRet = new sqlite3_mutex();
;//(sqlite3_mutex)malloc( sizeof( sqlite3_mutex ) );
}
else
{
pRet = g.aStatic[eType - 2];
}
pRet.eType = eType;
pRet.pReal = pReal;
return pRet;
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:29,代码来源:test_mutex_c.cs
示例2: noopMutexFree
static void noopMutexFree(sqlite3_mutex *p){ return; }
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:1,代码来源:mutex_noop_c.cs
示例3: noopMutexTry
static int noopMutexTry(sqlite3_mutex *p){ return SQLITE_OK; }
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:1,代码来源:mutex_noop_c.cs
示例4: sqlite3_mutex_leave
/*
** The sqlite3_mutex_leave() routine exits a mutex that was previously
** entered by the same thread. The behavior is undefined if the mutex
** is not currently entered. If a NULL pointer is passed as an argument
** this function is a no-op.
*/
static void sqlite3_mutex_leave(sqlite3_mutex p){
if( p !=null){
sqlite3GlobalConfig.mutex.xMutexLeave(p);
}
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:11,代码来源:mutex_c.cs
示例5: Mem0Global
public Mem0Global( int nScratchFree, int nPageFree, sqlite3_mutex mutex, sqlite3_int64 alarmThreshold, dxalarmCallback alarmCallback, object alarmArg, int Byte_Allocation, int Int_Allocation, int Mem_Allocation, int BtCursor_Allocation )
{
this.nScratchFree = nScratchFree;
this.nPageFree = nPageFree;
this.mutex = mutex;
this.alarmThreshold = alarmThreshold;
this.alarmCallback = alarmCallback;
this.alarmArg = alarmArg;
this.msByte.next = -1;
this.msInt.next = -1;
this.msMem.next = -1;
this.aByteSize = new int[] { 32, 256, 1024, 8192, 0 };
this.aByte_used = new int[] { -1, -1, -1, -1, -1 };
this.aByte = new byte[this.aByteSize.Length][][];
for ( int i = 0; i < this.aByteSize.Length; i++ ) this.aByte[i] = new byte[Byte_Allocation][];
this.aInt = new int[Int_Allocation][];
this.aMem = new Mem[Mem_Allocation <= 4 ? 4 : Mem_Allocation];
this.aBtCursor = new BtCursor[BtCursor_Allocation <= 4 ? 4 : BtCursor_Allocation];
}
开发者ID:arissetyawan,项目名称:rhodes,代码行数:19,代码来源:malloc_c.cs
示例6: sqlite3_mutex_notheld
static bool sqlite3_mutex_notheld(sqlite3_mutex p) {
return true;
}
开发者ID:TerabyteX,项目名称:ironpython3,代码行数:3,代码来源:mutex_c.cs
示例7: sqlite3_mutex_enter
/*
** Obtain the mutex p. If some other thread already has the mutex, block
** until it can be obtained.
*/
static void sqlite3_mutex_enter(sqlite3_mutex p){
if( p !=null){
sqlite3GlobalConfig.mutex.xMutexEnter(p);
}
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:9,代码来源:mutex_c.cs
示例8: counterMutexNotheld
/* Return true if the countable mutex is not currently held */
static bool counterMutexNotheld( sqlite3_mutex p )
{
return g.m.xMutexNotheld( p.pReal );
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:5,代码来源:test_mutex_c.cs
示例9: sqlite3_mutex_held
/*
** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are
** intended for use inside assert() statements.
*/
private static bool sqlite3_mutex_held(sqlite3_mutex p)
{
return p == null || sqlite3GlobalConfig.mutex.xMutexHeld(p);
}
开发者ID:broettge,项目名称:MatterControl,代码行数:9,代码来源:mutex_c.cs
示例10: counterMutexLeave
/* Leave a mutex
*/
static void counterMutexLeave( sqlite3_mutex p )
{
Debug.Assert( g.isInit );
g.m.xMutexLeave( p.pReal );
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:7,代码来源:test_mutex_c.cs
示例11: test_mutex_globals
public sqlite3_mutex[] aStatic = new sqlite3_mutex[6]; /* The six static mutexes */
public test_mutex_globals()
{
for ( int i = 0; i < aStatic.Length; i++ )
aStatic[i] = new sqlite3_mutex();
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:7,代码来源:test_mutex_c.cs
示例12: counterMutexTry
/*
** Try to enter a mutex. Return true on success.
*/
static int counterMutexTry( sqlite3_mutex p )
{
Debug.Assert( g.isInit );
g.aCounter[p.eType]++;
if ( g.disableTry )
return SQLITE_BUSY;
return g.m.xMutexTry( p.pReal );
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:11,代码来源:test_mutex_c.cs
示例13: counterMutexEnter
/*
** Enter a countable mutex. Block until entry is safe.
*/
static void counterMutexEnter( sqlite3_mutex p )
{
Debug.Assert( g.isInit );
g.aCounter[p.eType]++;
g.m.xMutexEnter( p.pReal );
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:9,代码来源:test_mutex_c.cs
示例14: counterMutexFree
/*
** Free a countable mutex
*/
static void counterMutexFree( sqlite3_mutex p )
{
Debug.Assert( g.isInit );
g.m.xMutexFree( p.pReal );
if ( p.eType == SQLITE_MUTEX_FAST || p.eType == SQLITE_MUTEX_RECURSIVE )
{
p = null;//free(p);
}
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:12,代码来源:test_mutex_c.cs
示例15: noopMutexHeld
/*
** 2008 October 07
**
** 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.
**
*************************************************************************
** This file contains the C functions that implement mutexes.
**
** This implementation in this file does not provide any mutual
** exclusion and is thus suitable for use only in applications
** that use SQLite in a single thread. The routines defined
** here are place-holders. Applications can substitute working
** mutex routines at start-time using the
**
** sqlite3_config(SQLITE_CONFIG_MUTEX,...)
**
** interface.
**
** If compiled with SQLITE_DEBUG, then additional logic is inserted
** that does error checking on mutexes to make sure they are being
** called correctly.
*************************************************************************
** Included in SQLite3 port to C#-SQLite; 2008 Noah B Hart
** C#-SQLite is an independent reimplementation of the SQLite software library
**
** SQLITE_SOURCE_ID: 2009-12-07 16:39:13 1ed88e9d01e9eda5cbc622e7614277f29bcc551c
**
*************************************************************************
*/
//#include "sqliteInt.h"
/*
** Stub routines for all mutex methods.
**
** This routines provide no mutual exclusion or error checking.
*/
static int noopMutexHeld(sqlite3_mutex p)
{
return 1;
}
开发者ID:taxilian,项目名称:some_library,代码行数:44,代码来源:mutex_noop_c.cs
示例16: debugMutexEnter
/*
** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt
** to enter a mutex. If another thread is already within the mutex,
** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return
** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK
** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can
** be entered multiple times by the same thread. In such cases the,
** mutex must be exited an equal number of times before another thread
** can enter. If the same thread tries to enter any other kind of mutex
** more than once, the behavior is undefined.
*/
static void debugMutexEnter( sqlite3_mutex pX )
{
sqlite3_debug_mutex p = (sqlite3_debug_mutex)pX;
Debug.Assert( p.id == SQLITE_MUTEX_RECURSIVE || debugMutexNotheld( p ) );
p.cnt++;
}
开发者ID:taxilian,项目名称:some_library,代码行数:17,代码来源:mutex_noop_c.cs
示例17: noopMutexLeave
static void noopMutexLeave(sqlite3_mutex p)
{
}
开发者ID:taxilian,项目名称:some_library,代码行数:3,代码来源:mutex_noop_c.cs
示例18: debugMutexFree
/*
** This routine deallocates a previously allocated mutex.
*/
static void debugMutexFree( sqlite3_mutex pX )
{
sqlite3_debug_mutex p = (sqlite3_debug_mutex)pX;
Debug.Assert( p.cnt == 0 );
Debug.Assert( p.id == SQLITE_MUTEX_FAST || p.id == SQLITE_MUTEX_RECURSIVE );
//sqlite3_free(ref p);
}
开发者ID:taxilian,项目名称:some_library,代码行数:10,代码来源:mutex_noop_c.cs
示例19: sqlite3_mutex_free
/*
** Free a dynamic mutex.
*/
static void sqlite3_mutex_free( sqlite3_mutex p){
if( p!=null ){
sqlite3GlobalConfig.mutex.xMutexFree( p);
}
}
开发者ID:Jaden-J,项目名称:csharp-sqlite,代码行数:8,代码来源:mutex_c.cs
示例20: noopMutexEnter
static void noopMutexEnter(sqlite3_mutex p)
{
}
开发者ID:taxilian,项目名称:some_library,代码行数:3,代码来源:mutex_noop_c.cs
注:本文中的Community.CsharpSqlite.sqlite3_mutex类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论