diff options
-rw-r--r-- | lang/python/wiredtiger.i | 25 | ||||
-rw-r--r-- | src/async/async_worker.c | 3 |
2 files changed, 27 insertions, 1 deletions
diff --git a/lang/python/wiredtiger.i b/lang/python/wiredtiger.i index e5f49fe2c63..ebd29116285 100644 --- a/lang/python/wiredtiger.i +++ b/lang/python/wiredtiger.i @@ -52,6 +52,9 @@ from packing import pack, unpack %typemap(in, numinputs=0) WT_SESSION ** (WT_SESSION *temp = NULL) { $1 = &temp; } +%typemap(in, numinputs=0) WT_ASYNC_OP ** (WT_ASYNC_OP *temp = NULL) { + $1 = &temp; +} %typemap(in, numinputs=0) WT_CURSOR ** (WT_CURSOR *temp = NULL) { $1 = &temp; } @@ -80,6 +83,28 @@ from packing import pack, unpack } } } +%typemap(argout) WT_ASYNC_OP ** { + $result = SWIG_NewPointerObj(SWIG_as_voidptr(*$1), + SWIGTYPE_p___wt_async_op, 0); + if (*$1 != NULL) { + PY_CALLBACK *pcb; + + PyObject_SetAttrString($result, "is_column", + PyBool_FromLong(strcmp((*$1)->key_format, "r") == 0)); + PyObject_SetAttrString($result, "key_format", + PyString_InternFromString((*$1)->key_format)); + PyObject_SetAttrString($result, "value_format", + PyString_InternFromString((*$1)->value_format)); + + if (__wt_calloc_def((WT_ASYNC_OP_IMPL *)(*$1), 1, &pcb) != 0) + SWIG_exception_fail(SWIG_MemoryError, "WT calloc failed"); + else { + Py_XINCREF($result); + pcb->pyobj = $result; + ((WT_ASYNC_OP_IMPL *)(*$1))->lang_private = pcb; + } + } +} %typemap(argout) WT_CURSOR ** { $result = SWIG_NewPointerObj(SWIG_as_voidptr(*$1), diff --git a/src/async/async_worker.c b/src/async/async_worker.c index 6c35a159529..84fd5817e54 100644 --- a/src/async/async_worker.c +++ b/src/async/async_worker.c @@ -85,7 +85,8 @@ __wt_async_worker(void *arg) * Dequeue op. We get here with the opqs lock held. */ op = &async->flush_op; - if (op == &async->flush_op && FLD_ISSET(async->opsq_flush, WT_ASYNC_FLUSH_IN_PROGRESS)) { + if (op == &async->flush_op && + FLD_ISSET(async->opsq_flush, WT_ASYNC_FLUSH_IN_PROGRESS)) { /* * We're the worker to take the flush op off the queue. * Set the flushing flag and set count to 1. |