#include "spdk_cunit.h"
-#include "common/lib/test_env.c"
+#include "common/lib/ut_multithread.c"
#include "unit/lib/json_mock.c"
+#include "spdk_internal/thread.h"
+
#include "bdev/pmem/bdev_pmem.c"
DEFINE_STUB(spdk_conf_find_section, struct spdk_conf_section *,
static const char *g_check_version_msg;
static bool g_pmemblk_open_allow_open = true;
-static void
-_pmem_send_msg(spdk_thread_fn fn, void *ctx, void *thread_ctx)
-{
- fn(ctx);
-}
-
static PMEMblkpool *
find_pmemblk_pool(const char *path)
{
void
spdk_bdev_io_get_buf(struct spdk_bdev_io *bdev_io, spdk_bdev_io_get_buf_cb cb, uint64_t len)
{
- cb(NULL, bdev_io);
+ cb(NULL, bdev_io, true);
}
static void
/* Unload module to free IO channel */
g_bdev_pmem_module->module_fini();
+ poll_threads();
- spdk_free_thread();
+ free_threads();
return 0;
}
{
errno = 0;
- spdk_allocate_thread(_pmem_send_msg, NULL, NULL, NULL, NULL);
+ allocate_threads(1);
+ set_thread(0);
g_pool_ok.buffer = calloc(g_pool_ok.nblock, g_pool_ok.bsize);
if (g_pool_ok.buffer == NULL) {
CU_basic_run_tests();
num_failures = CU_get_number_of_failures();
CU_cleanup_registry();
+
return num_failures;
}