Thread (Tiếng Việt)

Available since LÖVE 0.7.0
This type is not supported in earlier versions.

Thread (luồng) là một bó mã lệnh có thể chạy được song song với những luồng khác.

Nếu có lỗi xảy ra trong một luồng, thì sẽ có thông báo với tên "error" được gửi đến khu tạm chứa thông báo (message pool) của nó. Bạn có thể lấy thông báo này bằng lệnh Thread:receive('error').

Constructor

love.thread.newThread Creates a new Thread from a File or Data object.

Hàm

Object:type Gets the type of the object as a string.
Object:typeOf Checks whether an object is of a certain type.
Thread:demand Receive a message from a thread. Wait for the message to exist before returning.
Thread:get Get a value.
Thread:getKeys Returns the names of all messages in a table.
Thread:getName Get the name of a thread.
Thread:kill Forcefully terminate the thread.
Thread:peek Receive a message from a thread, but leave it in the message box.
Thread:receive Receive a message from a thread.
Thread:send Send a message.
Thread:set Set a value.
Thread:start Starts the thread.
Thread:wait Wait for a thread to finish.

Kiểu cấp trên

Object

Xem thêm

Ngôn ngữ khác

Personal tools