aboutsummaryrefslogtreecommitdiff
path: root/pl/episode_data.pl
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-06-06 00:24:13 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-06-06 00:24:13 +0200
commitc50bade7dd390784454e44a54a6bcac515d80531 (patch)
tree95ac44bfbb5d9992212b4d17531e9de5b238314c /pl/episode_data.pl
parentf9dc17e285b5d3100d3eb6dc80a38a621fafe1ae (diff)
downloadEpisodeBrowser-c50bade7dd390784454e44a54a6bcac515d80531.tar.gz
Add basic threading support.
It is much easier to implement on the Prolog side than on the C side... :-)
Diffstat (limited to 'pl/episode_data.pl')
-rw-r--r--pl/episode_data.pl7
1 files changed, 6 insertions, 1 deletions
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)),