Skip to content

Commit 9753f38

Browse files
committed
lock version 1.13.4 for _thread
1 parent 7547129 commit 9753f38

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

examples/_thread/thread_issue1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
def task2():
66
while True:
77
print("123")
8-
time.sleep_ms(2001)
8+
time.sleep_ms(201)
99

1010

1111
_thread.start_new_thread(task2, ())
1212

1313
while True:
14-
time.sleep_ms(2000)
14+
time.sleep_ms(200)

package/_thread/_thread.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "TinyObj.h"
44
#include "dataMemory.h"
55

6+
#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 13, 4)
7+
#error "pikapython version must be greater than 1.13.4"
8+
#endif
9+
610
static volatile int g_thread_stack_size = PIKA_THREAD_STACK_SIZE;
711
#if !PIKA_THREAD_MALLOC_STACK_ENABLE
812
extern volatile PikaMemInfo g_PikaMemInfo;
@@ -43,6 +47,8 @@ typedef struct pika_thread_info {
4347
static void _thread_func(void* arg) {
4448
pika_debug("thread start");
4549
pika_GIL_ENTER();
50+
PikaVMThread* vmThread = pikaVMThread_require();
51+
vmThread->is_sub_thread = 1;
4652
PikaObj* ctx = New_TinyObj(NULL);
4753
pika_thread_info* info = (pika_thread_info*)arg;
4854
if (NULL != info->args) {

port/linux/package/pikascript/pikascript-lib/_thread/_thread.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
#include "TinyObj.h"
44
#include "dataMemory.h"
55

6+
#if !PIKASCRIPT_VERSION_REQUIRE_MINIMUN(1, 13, 4)
7+
#error "pikapython version must be greater than 1.13.4"
8+
#endif
9+
610
static volatile int g_thread_stack_size = PIKA_THREAD_STACK_SIZE;
711
#if !PIKA_THREAD_MALLOC_STACK_ENABLE
812
extern volatile PikaMemInfo g_PikaMemInfo;

port/linux/version_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
MajorVersion = "1"
22
MinorVersion = "13"
3-
MicroVersion = "3"
3+
MicroVersion = "4"

src/PikaVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#define PIKA_VERSION_MAJOR 1
22
#define PIKA_VERSION_MINOR 13
3-
#define PIKA_VERSION_MICRO 3
3+
#define PIKA_VERSION_MICRO 4
44

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

0 commit comments

Comments
 (0)