diff options
Diffstat (limited to 'internal/threadtest2/threadtest2_linux_amd64.go')
-rw-r--r-- | internal/threadtest2/threadtest2_linux_amd64.go | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/internal/threadtest2/threadtest2_linux_amd64.go b/internal/threadtest2/threadtest2_linux_amd64.go index bc866c3..ba255f4 100644 --- a/internal/threadtest2/threadtest2_linux_amd64.go +++ b/internal/threadtest2/threadtest2_linux_amd64.go @@ -1,23 +1,23 @@ // Code generated by ccgo. DO NOT EDIT. -// threadtest2.c - -// 2004 January 13 -// -// 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 implements a simple standalone program used to test whether -// or not the SQLite library is threadsafe. -// -// This file is NOT part of the standard SQLite library. It is used for -// testing only. - +// threadtest2 +// /* +// ** 2004 January 13 +// ** +// ** 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 implements a simple standalone program used to test whether +// ** or not the SQLite library is threadsafe. +// ** +// ** This file is NOT part of the standard SQLite library. It is used for +// ** testing only. +// */ package main import ( @@ -55,16 +55,19 @@ var X__stdfiles [3]unsafe.Pointer var Xstdout unsafe.Pointer func init() { - Xstdout = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) + Xstdout = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 8) } var Xstderr unsafe.Pointer func init() { - Xstderr = (unsafe.Pointer)(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) + Xstderr = unsafe.Pointer(uintptr(unsafe.Pointer(&X__stdfiles)) + 16) } -// Initialize the database and start the threads +// C comment +// /* +// ** Initialize the database and start the threads +// */ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { var _i, _rc int32 var _1_zJournal *int8 @@ -75,7 +78,7 @@ func Xmain(tls *crt.TLS, _argc int32, _argv **int8) (r0 int32) { _1_zJournal = bin.Xsqlite3_mprintf(tls, str(17), unsafe.Pointer(str(0))) crt.Xunlink(tls, str(0)) crt.Xunlink(tls, _1_zJournal) - bin.Xsqlite3_free(tls, (unsafe.Pointer)(_1_zJournal)) + bin.Xsqlite3_free(tls, unsafe.Pointer(_1_zJournal)) } bin.Xsqlite3_open(tls, str(0), (**bin.Xsqlite3)(unsafe.Pointer(&_db))) if _db == nil { @@ -93,7 +96,7 @@ _3: if uint64(_i) >= u64(5) { goto _6 } - crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aThread))+8*uintptr(_i))), nil, Xworker, crt.U2P(uintptr(_i))) + crt.Xpthread_create(tls, (*uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aThread))+8*uintptr(_i))), nil, Xworker, crt.U2P(uintptr(_i))) _i += 1 goto _3 _6: @@ -102,7 +105,7 @@ _7: if uint64(_i) >= u64(5) { goto _10 } - crt.Xpthread_join(tls, *(*uint64)(unsafe.Pointer(uintptr((unsafe.Pointer)(&_aThread)) + 8*uintptr(_i))), nil) + crt.Xpthread_join(tls, *(*uint64)(unsafe.Pointer(uintptr(unsafe.Pointer(&_aThread)) + 8*uintptr(_i))), nil) _i += 1 goto _7 _10: @@ -117,7 +120,10 @@ _10: panic(0) } -// This is the worker thread +// C comment +// /* +// ** This is the worker thread +// */ func Xworker(tls *crt.TLS, _workerArg unsafe.Pointer) (r0 unsafe.Pointer) { var _id, _rc, _cnt int32 var _db unsafe.Pointer @@ -125,7 +131,7 @@ func Xworker(tls *crt.TLS, _workerArg unsafe.Pointer) (r0 unsafe.Pointer) { _cnt = i32(0) crt.Xfprintf(tls, (*crt.XFILE)(Xstderr), str(147), _id) _0: - if Xall_stop != 0 || postInc0(&_cnt, int32(1)) >= i32(10000) { + if Xall_stop != 0 || postInc0(&_cnt, 1) >= i32(10000) { goto _1 } if (_cnt % i32(100)) == i32(0) { |