Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
lektor
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Kubat
lektor
Validations
283cf906
Vérifiée
Valider
283cf906
rédigé
Il y a 5 ans
par
Kubat
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Everything compiles
parent
ec70295f
Branches
Branches contenant la validation
Étiquettes
Étiquettes contenant la validation
1 requête de fusion
!65
Resolve "Sync from kurisu"
Modifications
3
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
3 fichiers modifiés
inc/mthread/mthread.h
+1
-1
1 ajout, 1 suppression
inc/mthread/mthread.h
src/mthread/mthread.c
+3
-3
3 ajouts, 3 suppressions
src/mthread/mthread.c
src/repo/downloader.c
+15
-4
15 ajouts, 4 suppressions
src/repo/downloader.c
avec
19 ajouts
et
8 suppressions
inc/mthread/mthread.h
+
1
−
1
Voir le fichier @
283cf906
...
@@ -48,7 +48,7 @@ typedef struct mthread_sem_s mthread_sem_t;
...
@@ -48,7 +48,7 @@ typedef struct mthread_sem_s mthread_sem_t;
/* Function for handling threads. */
/* Function for handling threads. */
int
mthread_create
(
mthread_t
*
__threadp
,
const
mthread_attr_t
*
__attr
,
void
*
(
*
__start_routine
)
(
void
*
),
void
*
__arg
);
int
mthread_create
(
mthread_t
*
__threadp
,
const
mthread_attr_t
__attr
,
void
*
(
*
__start_routine
)
(
void
*
),
void
*
__arg
);
mthread_t
mthread_self
(
void
);
mthread_t
mthread_self
(
void
);
int
mthread_equal
(
mthread_t
__thread1
,
mthread_t
__thread2
);
int
mthread_equal
(
mthread_t
__thread1
,
mthread_t
__thread2
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/mthread/mthread.c
+
3
−
3
Voir le fichier @
283cf906
...
@@ -290,7 +290,7 @@ mthread_init(void)
...
@@ -290,7 +290,7 @@ mthread_init(void)
if ATTR is NULL), and call function START_ROUTINE with given
if ATTR is NULL), and call function START_ROUTINE with given
arguments ARG. */
arguments ARG. */
int
int
mthread_create
(
mthread_t
*
__threadp
,
const
mthread_attr_t
*
__attr
,
void
*
(
*
__start_routine
)
(
void
*
),
void
*
__arg
)
mthread_create
(
mthread_t
*
__threadp
,
const
mthread_attr_t
__attr
,
void
*
(
*
__start_routine
)
(
void
*
),
void
*
__arg
)
{
{
if
(
is_mthread_init
==
0
)
{
if
(
is_mthread_init
==
0
)
{
__mthread_lib_init
(
0
);
__mthread_lib_init
(
0
);
...
@@ -309,9 +309,9 @@ mthread_create(mthread_t *__threadp, const mthread_attr_t *__attr, void *(*__sta
...
@@ -309,9 +309,9 @@ mthread_create(mthread_t *__threadp, const mthread_attr_t *__attr, void *(*__sta
mthread_init_thread
(
mctx
);
mthread_init_thread
(
mctx
);
if
(
__attr
)
{
if
(
__attr
)
{
if
(
*
__attr
&
ATTR_DETACHED
)
if
(
__attr
&
ATTR_DETACHED
)
mctx
->
detached
=
DETACHED
;
mctx
->
detached
=
DETACHED
;
if
(
*
__attr
&
ATTR_DETACHED_FREE
)
if
(
__attr
&
ATTR_DETACHED_FREE
)
mctx
->
detached
=
DETACHED_FREE
;
mctx
->
detached
=
DETACHED_FREE
;
}
}
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/repo/downloader.c
+
15
−
4
Voir le fichier @
283cf906
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
#include
<mthread/mthread.h>
#include
<mthread/mthread.h>
#include
<lektor/macro.h>
#include
<lektor/macro.h>
#include
<lektor/repo.h>
#include
<lektor/repo.h>
#include
<lektor/
thread
.h>
#include
<lektor/
database
.h>
/* Find it in the repo/curl.c file. FIXME */
/* Find it in the repo/curl.c file. FIXME */
extern
int
extern
int
...
@@ -49,7 +49,13 @@ repo_download_id_async(struct lkt_repo *const repo, const size_t id)
...
@@ -49,7 +49,13 @@ repo_download_id_async(struct lkt_repo *const repo, const size_t id)
kara
->
id
=
id
;
kara
->
id
=
id
;
/* Thread */
/* Thread */
return
mthread_create
(
th
,
NULL
,
__repo_download_id_async
,
arg
);
mthread_t
*
th
=
calloc
(
1
,
sizeof
(
mthread_t
));
if
(
!
th
)
{
free
(
arg
);
LOG_ERROR_SCT
(
"REPO"
,
"%s"
,
"Out of memory"
);
return
1
;
}
return
mthread_create
(
th
,
ATTR_DETACHED_FREE
,
__repo_download_id_async
,
arg
);
}
}
/* Get all the kara, make them unavailable */
/* Get all the kara, make them unavailable */
...
@@ -96,7 +102,7 @@ __handle_got_json(volatile sqlite3 *db, struct lkt_repo *repo, struct json_objec
...
@@ -96,7 +102,7 @@ __handle_got_json(volatile sqlite3 *db, struct lkt_repo *repo, struct json_objec
if
(
safe_json_get_int32
(
kara_json
,
"song_number"
,
&
kara
->
mdt
.
song_number
))
if
(
safe_json_get_int32
(
kara_json
,
"song_number"
,
&
kara
->
mdt
.
song_number
))
goto
err
;
goto
err
;
if
(
database_update_add
(
db
,
kara
->
filename
,
&
kara
->
mdt
,
kara
->
id
,
false
))
if
(
database_update_add
(
(
sqlite3
*
)
db
,
kara
->
filename
,
&
kara
->
mdt
,
kara
->
id
,
false
))
LOG_ERROR_SCT
(
"REPO"
,
"Could not add unavailable kara %ld to db"
,
kara
->
id
);
LOG_ERROR_SCT
(
"REPO"
,
"Could not add unavailable kara %ld to db"
,
kara
->
id
);
goto
err
;
goto
err
;
}
}
...
@@ -119,5 +125,10 @@ __repo_get_all_id_async(void *arg)
...
@@ -119,5 +125,10 @@ __repo_get_all_id_async(void *arg)
inline
int
inline
int
repo_get_allid_async
(
struct
lkt_repo
*
const
repo
)
repo_get_allid_async
(
struct
lkt_repo
*
const
repo
)
{
{
return
mthread_create
(
th
,
NULL
,
__repo_get_all_id_async
,
repo
);
mthread_t
*
th
=
calloc
(
1
,
sizeof
(
mthread_t
));
if
(
!
th
)
{
LOG_ERROR_SCT
(
"REPO"
,
"%s"
,
"Out of memory"
);
return
1
;
}
return
mthread_create
(
th
,
ATTR_DETACHED_FREE
,
__repo_get_all_id_async
,
repo
);
}
}
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter