Skip to content

Commit

Permalink
lock version 1.13.4 for _thread
Browse files Browse the repository at this point in the history
  • Loading branch information
pikasTech committed Aug 8, 2024
1 parent 7547129 commit 9753f38
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/_thread/thread_issue1.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
def task2():
while True:
print("123")
time.sleep_ms(2001)
time.sleep_ms(201)


_thread.start_new_thread(task2, ())

while True:
time.sleep_ms(2000)
time.sleep_ms(200)
6 changes: 6 additions & 0 deletions package/_thread/_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "TinyObj.h"
#include "dataMemory.h"

#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 13, 4)
#error "pikapython version must be greater than 1.13.4"
#endif

static volatile int g_thread_stack_size = PIKA_THREAD_STACK_SIZE;
#if !PIKA_THREAD_MALLOC_STACK_ENABLE
extern volatile PikaMemInfo g_PikaMemInfo;
Expand Down Expand Up @@ -43,6 +47,8 @@ typedef struct pika_thread_info {
static void _thread_func(void* arg) {
pika_debug("thread start");
pika_GIL_ENTER();
PikaVMThread* vmThread = pikaVMThread_require();
vmThread->is_sub_thread = 1;
PikaObj* ctx = New_TinyObj(NULL);
pika_thread_info* info = (pika_thread_info*)arg;
if (NULL != info->args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#include "TinyObj.h"
#include "dataMemory.h"

#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 13, 4)
#error "pikapython version must be greater than 1.13.4"
#endif

static volatile int g_thread_stack_size = PIKA_THREAD_STACK_SIZE;
#if !PIKA_THREAD_MALLOC_STACK_ENABLE
extern volatile PikaMemInfo g_PikaMemInfo;
Expand Down
2 changes: 1 addition & 1 deletion port/linux/version_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
MajorVersion = "1"
MinorVersion = "13"
MicroVersion = "3"
MicroVersion = "4"
4 changes: 2 additions & 2 deletions src/PikaVersion.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define PIKA_VERSION_MAJOR 1
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 3
#define PIKA_VERSION_MICRO 4

#define PIKA_EDIT_TIME "2024/08/09 03:28:08"
#define PIKA_EDIT_TIME "2024/08/09 03:29:21"

0 comments on commit 9753f38

Please sign in to comment.