Whenever there is an unfit or insecure jail in any county, the judicial officers of such county may commit any persons brought before them, whether in a criminal or civil proceeding, to the jail of any adjoining county, for the same causes and under the like regulations that they might have ordered commitments to the usual jail; and the sheriffs and other officers of such county in which there is an unfit or insecure jail, and the sheriffs or keepers of the jails of the adjoining counties, shall obey any order of commitment so made.
N.C. Gen. Stat. § 162-38