From c50bade7dd390784454e44a54a6bcac515d80531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 6 Jun 2022 00:24:13 +0200 Subject: Add basic threading support. It is much easier to implement on the Prolog side than on the C side... :-) --- pl/episode_data.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pl') diff --git a/pl/episode_data.pl b/pl/episode_data.pl index f6c599c..167594d 100644 --- a/pl/episode_data.pl +++ b/pl/episode_data.pl @@ -5,7 +5,9 @@ episode_count/1, rate_episode/2, episode_rating/2, - tv_original/1]). + tv_original/1, + thread_running/1, + thread_exception/2]). :- use_module(library(clpfd)). :- use_module(library(dcg/basics)). @@ -72,6 +74,9 @@ tv_original(Ep) :- episode_datum(Ep, 'Source', 'TV Original'). absolute_url(R) --> "https://www.detectiveconanworld.com", R. +thread_running(T) :- thread_property(T, status(running)). +thread_exception(T, E) :- thread_property(T, status(exception(E))). + update_episode_data :- findall(Ep-Info, (fetch_episode_info(Ep, Info)), -- cgit v1.2.3