
150 Cal.App.3d 45 (1983)
197 Cal. Rptr. 458
THE PEOPLE, Plaintiff and Respondent,
v.
CLARENCE PHILLIP SCHAAF, Defendant and Appellant.
Docket No. FO02061.
Court of Appeals of California, Fifth District.
December 21, 1983.
*46 COUNSEL
Quin Denvir, State Public Defender, under appointment by the Court of Appeal, and Antonia D. Radillo, Deputy State Public Defender, for Defendant and Appellant.
John K. Van de Kamp, Attorney General, Arnold O. Overoye, Assistant Attorney General, Charles P. Just, W. Scott Thorpe and David DeAlba, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
FRANSON, Acting P.J. 

STATEMENT OF THE CASE
This case presents the recurring troublesome question of whether a defendant is entitled to presentence custody credit for the time spent in jail *47 awaiting sentence in a particular case while, at the same time, the defendant was serving a sentence on an unrelated offense. (1) We conclude that under In re Atiles (1983) 33 Cal.3d 805 [191 Cal. Rptr. 452, 662 P.2d 910] a defendant is entitled to credit for the entire time he spends in jail awaiting sentence if the restraint on the unrelated crime does not precede the restraint caused by the pending case. We reverse and remand with directions to award such credits to appellant.
Appellant was arrested on September 7, 1982, for the murder of Adam Ballesteros. After a preliminary hearing, appellant was charged by information in the superior court with the murder of Ballesteros as well as an attempted murder of Tomas Hernandez. Both counts charged the use of a firearm. On November 9, appellant pleaded not guilty, the public defender was appointed to represent appellant, and trial was set for January 10, 1983. Bail was fixed at $150,000.
On January 7, 1983, appellant pleaded guilty to voluntary manslaughter for the killing of Ballesteros with the use of a firearm. The other charges were dismissed. Appellant was sentenced to the upper term of six years for voluntary manslaughter plus two years for use of the firearm. Appellant was allowed only four days of presentence custody credit plus two days good-time/work-time credit.
Prior to and during these proceedings, appellant had other criminal charges pending against him in the Fresno Municipal Court. On November 12, 1980, in municipal court action No. F44823 appellant had pleaded nolo contendere to vehicular manslaughter and was placed on three years probation on condition he serve one-hundred eighty days in the county jail. Thereafter, on February 11, 1981, in municipal court action No. M461912, appellant failed to appear for arraignment on a drunk driving charge. A bench warrant was issued for appellant's arrest. On March 13, 1981, probation was revoked in the vehicular manslaughter action No. F44823 because of appellant's failure to appear for arraignment on the drunk driving charge in action No. M461912. A bench warrant was issued for appellant's arrest for violation of probation.
The two warrants described above were outstanding when appellant was arrested on September 7, 1982, for the killing of Ballesteros.
On September 10, 1982, appellant was sentenced in municipal court action F44823 to 180 days in the county jail for violation of probation with 10 days' credit allowed.
*48 On November 17, 1982, appellant was sentenced to 270 days for misdemeanor drunk driving in municipal court action No. M461912 with 168 days' credit allowed.

DISCUSSION
Penal Code section 2900.5[1] provides in pertinent part: "(a) In all felony and misdemeanor convictions, either by plea or by verdict, when the defendant has been in custody, including ... any time spent in a jail, ... all days of custody of the defendant, ... shall be credited upon his term of imprisonment,...
"(b) For the purposes of this section, credit shall be given only where the custody to be credited is attributable to proceedings related to the same conduct for which the defendant has been convicted. Credit shall be given only once for a single period of custody attributable to multiple offenses for which a consecutive sentence is imposed." (Emphasis added.)
The Supreme Court had occasion to construe the underscored limiting language of subdivision (b) in In re Rojas (1979) 23 Cal.3d 152 [151 Cal. Rptr. 649, 588 P.2d 789]. The petitioner in that case, while in prison for manslaughter, was charged with an unrelated murder and transferred to Los Angeles County jail to await trial. Upon being convicted and sentenced for the second offense, he contended that he was entitled to credit under section 2900.5 for the 207 days he spent in county jail. The issue was stated by the Supreme Court as whether defendant was entitled to credit for such time "when he would necessarily have served that 207 day period in state prison for the original manslaughter conviction and when he was already receiving credit for that period against his original conviction." (Id., at p. 155.) Reasoning from both the language of the statute and its apparent purpose, the court concluded that section 2900.5 did not authorize credit because the second offense had no effect on the defendant's liberty. (Id., at p. 156.)
Rojas specifically considered and rejected the petitioner's reliance upon In re Bentley (1974) 43 Cal. App.3d 988 [118 Cal. Rptr. 452]. In Bentley, petitioner had been on parole pursuant to a prior conviction when he was arrested for a new offense and confined pursuant to a parole hold while awaiting trial. The court in Bentley decided that subdivision (b) did not preclude credit in such a situation. It did so, however, on the basis of reasoning which the court in Rojas said was an "unnecessary semantic exercise ... [which] injected a nonexistent ambiguity into the statute" (In re *49 Rojas, supra, 23 Cal.3d at p. 157)  i.e., the court opined that credit was due because the language of the subsection "does not say `attributable exclusively to charges arising,'..." (In re Bentley, supra, 43 Cal. App.3d at p. 992.) Rojas said that this "questionable reasoning" had been applied in subsequent cases "to less favorable factual situations, thereby reaching results which do not appear to have been intended by the drafters of section 2900.5." (In re Rojas, supra, 23 Cal.3d at p. 157.) Rojas also disapproved this court's holding in In re Pollock (1978) 80 Cal. App.3d 779 [145 Cal. Rptr. 833] which had applied the Bentley reasoning in a different context.[2]
It is important to note that Rojas did not disapprove of the actual holding in Bentley. On the contrary, the court stated, "[t]he cases upon which defendant relies are, as closer analysis reveals, consistent with the foregoing interpretation of section 2900.5. In In re Bentley ..., the defendant was on parole pursuant to a prior narcotics conviction when he was arrested for robbery. It was the new charge which caused his loss of physical freedom and thus the time in custody for which he sought credit was based on the same conduct for which he was convicted, the robbery charge. A literal interpretation of section 2900.5 would have allowed Bentley his credit under those facts." (23 Cal.3d at p. 157, italics added.)
Courts of Appeal since Rojas have recognized Rojas' approval of the holding in Bentley as applied to the parole context. For example, in People v. Penner (1980) 111 Cal. App.3d 168 [168 Cal. Rptr. 431], the court distinguished Rojas, upholding an award of credit for six months' jail time during which the defendant was simultaneously serving a parole revocation period of custody and awaiting trial on charges based on the conduct underlying the parole revocation. The court noted it was clear that the same conduct was the basis for both proceedings and held that the six months of custody was therefore "attributable" to the new criminal proceedings, as well as to the parole revocation proceedings. (Id., at p. 170.) In In re Anderson (1982) 136 Cal. App.3d 472 [186 Cal. Rptr. 269], this court ordered credit to be awarded for time in local custody awaiting trial when defendant's parole had been revoked during this period. The Anderson court observed, "the crucial test is not whether a defendant is serving a sentence during the time he seeks credit for a second offense. Instead, Rojas requires that an inquiry be made into whether the second offense was the cause of the sentence being served." (Id., at p. 475.)
*50 Recently the Supreme Court has again spoken on the meaning of section 2900.5. In In re Atiles, supra, 33 Cal.3d 805, a prisoner serving a prison sentence for a robbery committed while he was on parole petitioned for a writ of habeas corpus seeking credit under section 2900.5 for time spent in county jail awaiting trial on the charges which led to his imprisonment. During that period, the prisoner was unable to obtain his freedom by posting bail because the Department of Corrections had placed a "hold" on him. Pursuant to this "hold," parole was revoked, and he was returned to custody for a six-month period. The trial court had granted credit for only three days of presentence confinement between parole hold expiration and the prisoner's release on bail.
The Supreme Court ordered the trial court to modify its judgment and grant the prisoner credit for the six-month period he was in jail. The majority rejected the argument that, because the prisoner's sentence confinement was attributable, in part, to the revocation of parole, he was not entitled to credit. It held that since the conduct which led to his arrest and conviction on new criminal charges also formed a basis for the parole hold and subsequent revocation proceedings, his custody in the county jail was literally "attributable to proceedings related to the same conduct for which the defendant has been convicted" as set forth in section 2900.5, subdivision (b). Thus, the holding in Atiles is consistent with In re Bentley, supra, 43 Cal. App.3d 988; People v. Penner, supra, 111 Cal. App.3d 168; In re Anderson, supra, 136 Cal. App.3d 472 and, of course, with Rojas, supra, 23 Cal.3d 152.
Atiles, however, speaks further on the question of presentence credits. Answering the Attorney General's argument that if the presentence custody is attributable to unrelated criminal acts, it is not "attributable" to the robbery conviction within the meaning of section 2900.5, the Atiles court explicitly states: "[Rojas] was not a holding that the custody must be attributable exclusively to the conduct underlying the term ultimately imposed.
"In determining whether custody for which credit is sought under section 2900.5 is `attributable to proceedings leading to the conviction,' the sentencing court is not required to eliminate all other possible bases for the defendant's presentence incarceration. The court need only determine that the defendant was not already serving a term for an unrelated offense when restraints related to the new charge were imposed on him, and the conduct related to the new charge is a basis for those restraints." (In re Atiles, supra, 33 Cal.3d at p. 810.)
"Restraints" which make it impossible for a defendant to obtain his freedom pending trial include a parole hold and bail fixed in an amount that the *51 defendant, whether indigent or not, cannot or does not post. (Id., at p. 811, fn. 5.)
Atiles continues: "We are satisfied that the Legislature intended that `custody ... attributable to proceedings related to the same conduct for which the defendant has been convicted' include time in presentence custody during which a restraint or restraints related to that conduct made it impossible for the defendant to obtain his freedom, regardless of whether the defendant was also subject to other restraints on his liberty. Our conclusion is based on the literal language of subdivision (b) of section 2900.5, pursuant to the well established principle of statutory interpretation that if no ambiguity, uncertainty, or doubt about the meaning of a statute appears, the provision is to be applied according to its terms without further judicial construction. [Citation.]" (Id., at p. 811, italics added.) Atiles further states, "[E]ven if we were to perceive ambiguity in subdivision (b), our construction of this provision would be required by familiar rules which call for construction to effectuate the legislative purpose [citation] and, in the case of penal statutes, for the resolution of ambiguity in favor of the criminal defendant [citation]." (Id., at p. 812.)
Justice Grodin, writing for the majority in Atiles, then discusses equal protection of the law in the context of presentence credits. He asserts that unequal treatment may result from "denial of credit on multiple concurrent terms" (id., at p. 812) and lists examples of situations in which defendants may or may not be denied credits depending upon the speed of the criminal proceedings. Justice Grodin characterizes the time between "sentencing in the first proceeding and that in the second" as "dead time" as to the second sentence and notes that the Legislature has not chosen to expressly deny dual credits in such situations.
Appellant's sentence in the instant case was not made consecutive with any other sentence; it was a concurrent sentence to any prior uncompleted sentence. If appellant had entered his guilty plea to the shooting of Ballesteros back in October or November of 1982 rather than on January 7, 1983, he would have received the benefit of full credit on his sentence regardless of the unrelated misdemeanor sentences since his prison term would have commenced upon the date of his sentencing. Since appellant was not in full control over the timing of his guilty plea, under Justice Grodin's analysis it would be a denial of equal protection of the law to disallow him credit for the full time spent in the Fresno County jail before sentencing in the instant case.
We conclude from Atiles that except for the Rojas situation where the defendant is already serving a sentence when restraints related to the instant *52 sentencing are first imposed, that a defendant is entitled to presentence credit under section 2900.5 for all presentence jail time spent while awaiting sentence in the pending case. Such presentence jail time is deemed attributable to the pending offense even though restraints on other unrelated cases were also imposed on the defendant, provided that the restraints on the unrelated cases did not precede the restraints caused by the pending case. A contrary holding would fly in the face of the Atiles' reasoning that denial of credit on the two theoretically concurrent terms would produce unequal treatment.
The judgment is modified to provide that appellant shall receive additional presentence actual time and conduct credits for the period from September 7, 1982, to February 7, 1983. The trial court is directed to prepare an amended abstract of judgment which reflects that modification and forward a certified copy of same to the appropriate authorities. As so modified, the judgment is affirmed.
Zenovich, J., and Gallagher, J.,[*] concurred.
Respondent's petition for a hearing by the Supreme Court was denied March 14, 1984.
NOTES
[1]  All references hereinafter are to the Penal Code unless otherwise stated.
[2]  In Pollock this court interpreted section 2900.5 "to provide that a defendant is entitled to receive credit upon a prison sentence for time spent in jail awaiting disposition of the criminal proceedings resulting in that sentence even though during that same period of jail time the defendant is serving a prison sentence on another conviction." (In re Pollock, supra, 80 Cal. App.3d at p. 783.)
[*]   Assigned by the Chairperson of the Judicial Council.
