åºæ¬çã« Thread.new ã¨åãã§ããã new ã¡ã½ããã¨éã initialize ã¡ã½ãããå¼ã³ã¾ããã
502 Bad Gateway
ã®æå³ãåãããªãã¦ãinitializeãå¼ãã§ããånewã®æ¹ããªã¼ãã¼ããããã§ããããããªããã¨æã£ã¦ããã³ããã¼ã¯ã¨ã£ã¦ã¿ããã©ãã»ã¨ãã©å·®ããªãã¦ããã¼ãã£ã¦ãªã£ã¦ããã®ã§ããããã¨ã°ããã«ZnZããã«æãã¦ããã ãã¾ããã
çµå±ä½ãéããã¨ããããThreadãç¶æ¿ããã¯ã©ã¹ã使ãã¨ãã«ãnewã¡ã½ããã ã¨ãã®ãµãã¯ã©ã¹ã®initializeãå¼ã°ãã¦ãsratr(fork)ã¡ã½ããã ã¨å¼ã°ããªãã¨ããç¹ã§ãã
以ä¸ã®æ¤è¨¼ã³ã¼ãã§è©¦ãã¦ã¿ã¾ããã
class MyThread < Thread def initialize super puts 'MyThread was created' end end MyThread.new { p:new }.join p:=== MyThread.start { p:start }.join
çµæã¯ã
:new MyThread was created :=== :start
ãªãã»ã©ããªãã»ã©ã