Breadcrumbs

thread_pause()

Definition

thread_pause(th_id)

Features

This function temporarily suspends a thread.

Parameters

Parameter Name

Data Type

Default Value

Description

th_id

int

-

Thread ID to suspend

Return

Value

Description

0

Success

Negative value

Failed

Exception

Exception

Description

DR_Error (DR_ERROR_TYPE)

Parameter data type error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example

Python
def fn_th_func():
	if check_motion()==0:	# No motion in action
		set_digital_output(1, OFF)
	else:
		set_digital_output(1, ON)
#----- Main routine --------------------------------------
th_id = thread_run(fn_th_func, loop=True)

# do something…

thread_pause(th_id) # Suspends the thread.