Date: 20160514
Because child threads do not load the user setting init
file.
Some global variables may be difference from parent thread.
This function provides a very easy way to set variables in child thread the same as parent thread.
(setq a 1)
(setq b "a")
;; Setup two variables
(setq mythread (timp-get :persist t))
;; Create a new thread
(timp-send-code mythread
:error-handler 'timp-debug-print
:code `(message "a is %d" a))
;; t
;; In *timp log*
;; $ ((message "a is %d" a) void-variable a)
(timp-send-code mythread
:error-handler 'timp-debug-print
:code `(message "b is %s" b))
;; t
;; In *timp log*
;; $((message "b is %d" b) void-variable b)
(timp-send-variable mythread a b)
;; t
(timp-send-code mythread
:error-handler 'timp-debug-print
:code `(message "a is %d" a))
;; a is 1
(timp-send-code mythread
:error-handler 'timp-debug-print
:code `(message "b is %s" b))
;; b is a
;; Now a and b are both set up in child thread