\hypertarget{g__uzip__wrkthr_8c_source}{}\doxysection{g\+\_\+uzip\+\_\+wrkthr.\+c}
\label{g__uzip__wrkthr_8c_source}\index{geom/uzip/g\_uzip\_wrkthr.c@{geom/uzip/g\_uzip\_wrkthr.c}}
\mbox{\hyperlink{g__uzip__wrkthr_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2006-\/2016 Maxim Sobolev <sobomax@FreeBSD.org>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00003}00003 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00004}00004 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00005}00005 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00006}00006 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00007}00007 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00008}00008 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00009}00009 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00010}00010 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00012}00012 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00013}00013 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00014}00014 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00015}00015 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00016}00016 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00017}00017 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00018}00018 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00019}00019 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00020}00020 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00021}00021 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00022}00022 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00023}00023 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00024}00024 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00025}00025 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00026}00026 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00027}00027 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00028}\mbox{\hyperlink{g__uzip__wrkthr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00028}} \mbox{\hyperlink{g__uzip__wrkthr_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00030}00030 \textcolor{preprocessor}{\#include <sys/types.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00031}00031 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00032}00032 \textcolor{preprocessor}{\#include <sys/lock.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00033}00033 \textcolor{preprocessor}{\#include <sys/mutex.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/bio.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/proc.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/sched.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/kthread.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00038}00038 \textcolor{preprocessor}{\#include <sys/malloc.h>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00039}00039 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__uzip_8h}{geom/uzip/g\_uzip.h}}>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00041}00041 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__uzip__softc_8h}{geom/uzip/g\_uzip\_softc.h}}>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{g__uzip__wrkthr_8h}{geom/uzip/g\_uzip\_wrkthr.h}}>}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00044}00044 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00045}\mbox{\hyperlink{g__uzip__wrkthr_8c_af5c8193712b64667b1abd68b80db2c1c}{00045}} \mbox{\hyperlink{g__uzip__wrkthr_8c_af5c8193712b64667b1abd68b80db2c1c}{g\_uzip\_wrkthr}}(\textcolor{keywordtype}{void} *arg)}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00046}00046 \{}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00047}00047         \textcolor{keyword}{struct }\mbox{\hyperlink{structg__uzip__softc}{g\_uzip\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00048}00048         \textcolor{keyword}{struct }bio *\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}};}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00049}00049 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00050}00050         sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structg__uzip__softc}{g\_uzip\_softc}} *)arg;}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00051}00051         thread\_lock(curthread);}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00052}00052         sched\_prio(curthread, PRIBIO);}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00053}00053         thread\_unlock(curthread);}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00054}00054 }
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00055}00055         \textcolor{keywordflow}{for} (;;) \{}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00056}00056                 mtx\_lock(\&sc-\/>\mbox{\hyperlink{structg__uzip__softc_a2c6961745d0c52af4f902a96a47a4b17}{queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00057}00057                 \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structg__uzip__softc_aa6b658a9848f798dce12579eb0781c06}{wrkthr\_flags}} \& \mbox{\hyperlink{g__uzip__softc_8h_a8511eda78a1c387f9670b6ef05865ddd}{GUZ\_SHUTDOWN}}) \{}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00058}00058                         sc-\/>\mbox{\hyperlink{structg__uzip__softc_aa6b658a9848f798dce12579eb0781c06}{wrkthr\_flags}} |= \mbox{\hyperlink{g__uzip__softc_8h_a07ee2d1c79c5ed3e51a5a43464dde2b0}{GUZ\_EXITING}};}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00059}00059                         mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__uzip__softc_a2c6961745d0c52af4f902a96a47a4b17}{queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00060}00060                         kproc\_exit(0);}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00061}00061                 \}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00062}00062                 \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}} = bioq\_takefirst(\&sc-\/>\mbox{\hyperlink{structg__uzip__softc_a69f2383ffdc26d6b3f8008907db633ad}{bio\_queue}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00063}00063                 \textcolor{keywordflow}{if} (!\mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}}) \{}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00064}00064                         msleep(sc, \&sc-\/>\mbox{\hyperlink{structg__uzip__softc_a2c6961745d0c52af4f902a96a47a4b17}{queue\_mtx}}, PRIBIO | PDROP,}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00065}00065                             \textcolor{stringliteral}{"{}wrkwait"{}}, 0);}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00066}00066                         \textcolor{keywordflow}{continue};}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00067}00067                 \}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00068}00068                 mtx\_unlock(\&sc-\/>\mbox{\hyperlink{structg__uzip__softc_a2c6961745d0c52af4f902a96a47a4b17}{queue\_mtx}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00069}00069                 sc-\/>\mbox{\hyperlink{structg__uzip__softc_a9b3f751949526b48c68271a295c695bd}{uzip\_do}}(sc, \mbox{\hyperlink{g__part__if_8m_a3786db8db96c32f69df9f7cd325a7507}{bp}});}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00070}00070         \}}
\DoxyCodeLine{\Hypertarget{g__uzip__wrkthr_8c_source_l00071}00071 \}}

\end{DoxyCode}
